1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
struct SEntityPhysicalizeParams
{///////////////////////////////////////////////////////////////////
SEntityPhysicalizeParams() : type(0),density(-1),mass(-1),nSlot(-1),nFlagsOR(0),nFlagsAND(UINT_MAX),
pAttachToEntity(NULL),nAttachToPart(-1),fStiffnessScale(0), bCopyJointVelocities(false),
pParticle(NULL),pBuoyancy(NULL),pPlayerDimensions(NULL),pPlayerDynamics(NULL),pCar(NULL),pAreaDef(NULL),nLod(0),szPropsOverride(0) {};
//////////////////////////////////////////////////////////////////////////
// Physicalization type must be one of pe_type ennums.
// See Also: pe_type
int type; // Always must be filled.
// Index of object slot. -1 if all slots should be used.
int nSlot;
// Only one either density or mass must be set, parameter set to 0 is ignored.
float density;
float mass;
// Optional physical flags.
int nFlagsAND;
int nFlagsOR;
// When physicalizing geometry can specify to use physics from different LOD.
// Used for characters that have ragdoll physics in Lod1
int nLod;
// Physical entity to attach this physics object (Only for Soft physical entity).
IPhysicalEntity *pAttachToEntity;
// Part ID in entity to attach to (Only for Soft physical entity).
int nAttachToPart;
// Used for character physicalization (Scale of force in character joint's springs).
float fStiffnessScale;
// Copy joints velocities when converting a character to ragdoll.
bool bCopyJointVelocities;
struct pe_params_particle *pParticle;
struct pe_params_buoyancy *pBuoyancy;
struct pe_player_dimensions *pPlayerDimensions;
struct pe_player_dynamics *pPlayerDynamics;
struct pe_params_car *pCar;
//////////////////////////////////////////////////////////////////////////
// This parameters are only used when type == PE_AREA
//////////////////////////////////////////////////////////////////////////
struct AreaDefinition
{
enum EAreaType {
AREA_SPHERE, // Physical area will be sphere.
AREA_BOX, // Physical area will be box.
AREA_GEOMETRY, // Physical area will use geometry from the specified slot.
AREA_SHAPE, // Physical area will points to specify 2D shape.
AREA_CYLINDER, // Physical area will be a cylinder
AREA_SPLINE, // Physical area will be a spline-tube
};
EAreaType areaType;
float fRadius; // Must be set when using AREA_SPHERE or AREA_CYLINDER area type or an AREA_SPLINE.
Vec3 boxmin,boxmax; // Min,Max of bounding box, must be set when using AREA_BOX area type.
Vec3 *pPoints; // Must be set when using AREA_SHAPE area type or an AREA_SPLINE.
int nNumPoints; // Number of points in pPoints array.
float zmin,zmax; // Min/Max of points.
Vec3 center;
Vec3 axis;
// pGravityParams must be a valid pointer to the area gravity params structure.
struct pe_params_area *pGravityParams;
AreaDefinition() : areaType(AREA_SPHERE),fRadius(0),boxmin(0,0,0),boxmax(0,0,0),
pPoints(NULL),nNumPoints(0),pGravityParams(NULL),zmin(0),zmax(0),center(0,0,0),axis(0,0,0) {}
};
// When physicalizing with type == PE_AREA this must be a valid pointer to the AreaDefinition structure.
AreaDefinition *pAreaDef;
// an optional string with text properties overrides for CGF nodes
const char *szPropsOverride;
|