vrdPhysicsConfig¶
-
class
vrdPhysicsConfig
¶
(Inherits vrdData
)
The base class for all physics configuration classes.
Physics configurations are used to specify the properties of physics objects during its creation.
Summary¶
Functions¶
-
vrdPhysicsConfig.
getContactOffset
()¶ Get the contact offset.
Returns: The contact offset value. Return type: float
-
vrdPhysicsConfig.
getRestOffset
()¶ Get the rest offset.
Returns: The rest offset value. Return type: float
-
vrdPhysicsConfig.
getType
()¶ Get the type of the physics object (ConvexHull, Triangles, ConvexDecomp).
Returns: The type of the physics object. Return type: vrPhysicsTypes.ObjectType
-
vrdPhysicsConfig.
isAllowInvisibleCollision
()¶ Check if the object will collide with other objects while invisible.
Returns: True if the object will collide with other objects while invisible, False otherwise. Return type: bool
-
vrdPhysicsConfig.
setAllowInvisibleCollision
(state)¶ Set whether the object will collide with other objects while invisible.
If this is enabled, the object will still collide with other objects even if it is set to invisible.
Parameters: state (bool) – The state indicating wheter the object will collide with other objects while invisible.
-
vrdPhysicsConfig.
setContactOffset
(offset)¶ Set the contact offset.
From the PhysX documentation: Shapes whose distance is less than the sum of their contactOffset values will generate contacts. The contact offset must be positive and greater than the rest offset. Having a contactOffset greater than the restOffset allows the collision detection system to predictively enforce the contact constraint even when the objects are slightly separated. This prevents jitter that would occur if the constraint were enforced only when shapes were within the rest distance.
The default value is 0.02.
Parameters: offset (float) – The contact offset value.
-
vrdPhysicsConfig.
setRestOffset
(offset)¶ Set the rest offset.
From the PhysX documentation: Two shapes will come to rest at a distance equal to the sum of their restOffset values. If the restOffset is 0, they should converge to touching exactly. Having a restOffset greater than zero is useful to have objects slide smoothly, so that they do not get hung up on irregularities of each others’ surfaces.
The default value is 0.0.
Parameters: offset (float) – The rest offset value.