SetCollisionObjProperty

From GECK
Jump to: navigation, search


A function added by the JIP NVSE Plugin.

Description

Sets the value of a specified property of the collision object (if any) attached to the specified node in the calling reference's loaded 3D model.

  • Alternatively, an asterisk "*" may be passed as the node name, in which case the property value will be set for any child node of the reference's node that has collision.

Syntax

[help]
reference.SetCollisionObjProperty nodeName:string propertyID:int{0-7} newValue:float

Property IDs

0	Friction
1	Restitution
2	Linear Damping
3	Angular Damping
4	Inertia: X
5	Inertia: Y
6	Inertia: Z
7	Body Mass

Example

objectRef.SetCollisionObjProperty "TumbleweedNV" 2 0.15
objectRef.SetCollisionObjProperty "*" 2 0.15 

Notes

  • Friction - Surface smoothness; how easily it slides along other bodies.
  • Restitution - Body bounciness; how much energy it has after colliding. Less than 1.0 loses energy; greater than 1.0 gains energy.
  • Linear Damping - Rate of linear deceleration. A value of 0.1 will remove 10% linear velocity every second.
  • Angular Damping - Rate of angular deceleration. A value of 0.05 will remove 5% angular velocity every second.
  • Inertia: X/Y/Z - Resistance to change in velocity or direction of motion (per axis) from external forces.
  • Body Mass - The body's mass in kg. A mass of zero represents an immovable object.

See Also