To act as sample code and a starting point for new physics objects, Gyro provides several object macros in gyro_user.qc
that may be applied immediately to any entity you chose. As Gyro grows, more macros will be added to the packaged user file but, in the meantime, the current list may be found here:
Grenades
Grenades are very simple objects that use Gyro's most basic subsystems. As a metallic object, they are heavy enough to experience little air resistance and lack the bouyancy to float in water.
void(entity e, float mass) Gyro_ObjectMacro_Grenade = { Gyro_Object_Activate(e, mass); Gyro_Object_SetBouyancy(e, mass*0.6); Gyro_Object_SetResistance(e, mass*0.4); Gyro_Object_SetAerodynamics(e, mass*0.8); };
Gibs
Unlike grenades, gibs are able to float in water. To create the impression of waves on the surface, gibs are given a small degree of turbulence.
void(entity e, float mass) Gyro_ObjectMacro_Gib = { Gyro_Object_Activate(e, mass); Gyro_Object_SetBouyancy(e, mass*1.2); Gyro_Object_SetResistance(e, mass*0.6); Gyro_Object_SetAerodynamics(e, mass*0.6); Gyro_Object_SetTurbulence(e, mass*0.24, 0.95); Gyro_Object_SetGlobalTurb(e, mass*0.16, 0.95); };
Rockets
Rockets are propelled by a constant, powerful thrust. They are mildly bouyant, which makes them appear to arc upwards when submerged. To ensure they point in correct direction while under water or when deflected by a force, they are also given a high aerodynamic level.
void(entity e, float mass, float thrustpower) Gyro_ObjectMacro_Rocket = { Gyro_Object_Activate(e, mass); Gyro_Object_SetBouyancy(e, mass*0.8); Gyro_Object_SetResistanceMod(e, mass, 0.02, 1.0, 1.2, 1.4); Gyro_Object_SetAerodynamics(e, mass*8.0); Gyro_Object_SetThrust(e, thrustpower); };
Drunk Missile
A classic drunk missile launcher fires several missiles which appear to randomly duck and weave, as if intoxicated. Gyro is able to power this behaviour by applying angular turbulence to a regular dumb-fire missile.
void(entity e, float mass, float thrustpower) Gyro_ObjectMacro_DrunkMissile = { Gyro_Object_Activate(e, mass); Gyro_Object_SetBouyancy(e, mass*0.8); Gyro_Object_SetResistance(e, mass*1.2); Gyro_Object_SetAerodynamics(e, mass*8.0); Gyro_Object_SetAngleTurb(e, mass*40.0); Gyro_Object_SetThrust(e, thrustpower); };