pe_simulation_params

#include

Inherits pe_params.

Public Types

enum entype { type_id = ePE_simulation_params }

Public Attributes

int iSimClass
float maxTimeStep
Maximum time step that entity can accept (larger steps will be split).
float minEnergy
Minimun of kinetic energy below which entity falls asleep (divided by mass).
float damping
Damped velocity = oridinal velocity * (1 - damping*time interval).
Vec3 gravity
Per-entity gravity (note that if there are any phys areas with gravity, they will override it unless pef_ignore_areas is set.
float dampingFreefall
Damping and gravity used when there are no collisions.
Vec3 gravityFreefall
NOTE: if left unused, gravity value will be substituted (if provided).
float maxRotVel
Rotational velocity is clamped to this value.
float mass
Either mass of density should be set; mass = density*volume.
float density
int maxLoggedCollisions
Maximum EventPhysCollisions reported per frame (only supported by rigid bodies/ragdolls/vehicles).
int disablePreCG
Disables Pre-CG solver for the group this body is in (recommended for balls).
float maxFriction
Sets upper friction limit for this object and all objects it's currently in contact with.
int collTypes
Collision types (a combination of ent_xxx flags).

Detailed Description

Used to set or get simulation parameters such as gravity and mass

#include 

// Queries the simulation parameters of an entity, for example to check current gravitational influence or mass.
void GetSimulationParameters(IPhysicalEntity& physicalEntity)
{
    pe_simulation_params simulationParameters;
    if (physicalEntity.GetParams(&simulationParameters))
    {
        /* simulationParameters can now be used */
    }
}