iJoint Struct Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions
iJoint Struct Reference

A joint that can constrain the relative motion between two iRigidBody. More...

`#include <ivaria/dynamics.h>`

Inheritance diagram for iJoint:

List of all members.

## Public Member Functions
virtual void | Attach (iRigidBody *body1, iRigidBody *body2, bool force_update=true)=0
| Set the rigid bodies that will be affected by this joint.
virtual csVector3 | GetAngularConstraintAxis (int body)=0
| Get the custom angular constraint axis.
virtual csRef< iRigidBody > | GetAttachedBody (int body)=0
| Get the attached body with the given index (valid values for body are 0 and 1).
virtual csVector3 | GetBounce ()=0
| Get the joint restitution.
virtual csVector3 | GetDesiredVelocity ()=0
| Get the desired velocity of the joint motor.
virtual csVector3 | GetMaxForce ()=0
| Get the maximum force that can be applied by the joint motor to reach the desired velocity.
virtual csVector3 | GetMaximumAngle ()=0
| Get the maximum allowed angle between the two bodies (in radian).
virtual csVector3 | GetMaximumDistance ()=0
| Get the maximum allowed distance between the two bodies.
virtual csVector3 | GetMinimumAngle ()=0
| Get the minimum allowed angle between the two bodies (in radian).
virtual csVector3 | GetMinimumDistance ()=0
| Get the minimum allowed distance between the two bodies.
virtual csOrthoTransform | GetTransform ()=0
| Get the local transformation of the joint, relative to the second body attached.
virtual bool | IsXRotConstrained ()=0
| True if this axis' rotation is constrained, ie no motion allowed.
virtual bool | IsXTransConstrained ()=0
| True if this axis' translation is constrained, ie no motion allowed.
virtual bool | IsYRotConstrained ()=0
| True if this axis' rotation is constrained, ie no motion allowed.
virtual bool | IsYTransConstrained ()=0
| True if this axis' translation is constrained, ie no motion allowed.
virtual bool | IsZRotConstrained ()=0
| True if this axis' rotation is constrained, ie no motion allowed.
virtual bool | IsZTransConstrained ()=0
| True if this axis' translation is constrained, ie no motion allowed.
virtual bool | RebuildJoint ()=0
| Rebuild the joint using the current setup.
virtual void | SetAngularConstraintAxis (const csVector3 &axis, int body, bool force_update=true)=0
| Set a custom angular constraint axis (have sense only with rotation free minimum along 2 axis).
virtual void | SetBounce (const csVector3 &bounce, bool force_update=true)=0
| Set the restitution of the joint's stop point (this is the elasticity of the joint when say throwing open a door how much it will bounce the door back closed when it hits).
virtual void | SetDesiredVelocity (const csVector3 &velocity, bool force_update=true)=0
| Apply a motor velocity to joint (for instance on wheels).
virtual void | SetMaxForce (const csVector3 &maxForce, bool force_update=true)=0
| Set the maximum force that can be applied by the joint motor to reach the desired velocity.
virtual void | SetMaximumAngle (const csVector3 &max, bool force_update=true)=0
| Set the maximum allowed angle between the two bodies (in radian).
virtual void | SetMaximumDistance (const csVector3 &max, bool force_update=true)=0
| Set the maximum allowed distance between the two bodies.
virtual void | SetMinimumAngle (const csVector3 &min, bool force_update=true)=0
| Set the minimum allowed angle between the two bodies, in radian.
virtual void | SetMinimumDistance (const csVector3 &min, bool force_update=true)=0
| Set the minimum allowed distance between the two bodies.
virtual void | SetRotConstraints (bool X, bool Y, bool Z, bool force_update=true)=0
| Set the rotational constraints on the 3 axes.
virtual void | SetTransConstraints (bool X, bool Y, bool Z, bool force_update=true)=0
| Set the translation constraints on the 3 axes.
virtual void | SetTransform (const csOrthoTransform &trans, bool force_update=true)=0
| Set the local transformation of the joint, relative to the second body attached.

## Detailed Description

A joint that can constrain the relative motion between two iRigidBody.

For instance if all motion in along the local X axis is constrained then the bodies will stay motionless relative to each other along an x axis rotated and positioned by the joint's transform.

Main creators of instances implementing this interface:

- iDynamicSystem::CreateJoint()

Main users of this interface:

- iDynamicSystem

Definition at line 1079 of file dynamics.h.

## Member Function Documentation

virtual void iJoint::Attach | ( | iRigidBody * | body1,
|  | iRigidBody * | body2,
|  | bool | force_update = `true`
| ) |  | `[pure virtual]`

Set the rigid bodies that will be affected by this joint.

Set force_update to true if you want to apply the changes right away.

virtual csVector3 iJoint::GetAngularConstraintAxis | ( | int | body | ) | `[pure virtual]`

Get the custom angular constraint axis.

virtual csRef<iRigidBody> iJoint::GetAttachedBody | ( | int | body | ) | `[pure virtual]`

Get the attached body with the given index (valid values for body are 0 and 1).

virtual csVector3 iJoint::GetBounce | ( |  | ) | `[pure virtual]`

Get the joint restitution.

virtual csVector3 iJoint::GetDesiredVelocity | ( |  | ) | `[pure virtual]`

Get the desired velocity of the joint motor.

virtual csVector3 iJoint::GetMaxForce | ( |  | ) | `[pure virtual]`

Get the maximum force that can be applied by the joint motor to reach the desired velocity.

virtual csVector3 iJoint::GetMaximumAngle | ( |  | ) | `[pure virtual]`

Get the maximum allowed angle between the two bodies (in radian).

virtual csVector3 iJoint::GetMaximumDistance | ( |  | ) | `[pure virtual]`

Get the maximum allowed distance between the two bodies.

virtual csVector3 iJoint::GetMinimumAngle | ( |  | ) | `[pure virtual]`

Get the minimum allowed angle between the two bodies (in radian).

virtual csVector3 iJoint::GetMinimumDistance | ( |  | ) | `[pure virtual]`

Get the minimum allowed distance between the two bodies.

virtual csOrthoTransform iJoint::GetTransform | ( |  | ) | `[pure virtual]`

Get the local transformation of the joint, relative to the second body attached.

virtual bool iJoint::IsXRotConstrained | ( |  | ) | `[pure virtual]`

True if this axis' rotation is constrained, ie no motion allowed.

virtual bool iJoint::IsXTransConstrained | ( |  | ) | `[pure virtual]`

True if this axis' translation is constrained, ie no motion allowed.

virtual bool iJoint::IsYRotConstrained | ( |  | ) | `[pure virtual]`

True if this axis' rotation is constrained, ie no motion allowed.

virtual bool iJoint::IsYTransConstrained | ( |  | ) | `[pure virtual]`

True if this axis' translation is constrained, ie no motion allowed.

virtual bool iJoint::IsZRotConstrained | ( |  | ) | `[pure virtual]`

True if this axis' rotation is constrained, ie no motion allowed.

virtual bool iJoint::IsZTransConstrained | ( |  | ) | `[pure virtual]`

True if this axis' translation is constrained, ie no motion allowed.

virtual bool iJoint::RebuildJoint | ( |  | ) | `[pure virtual]`

Rebuild the joint using the current setup.

Return true if the rebuilding operation was successful (otherwise the joint won't be active).

virtual void iJoint::SetAngularConstraintAxis | ( | const csVector3 & | axis,
|  | int | body,
|  | bool | force_update = `true`
| ) |  | `[pure virtual]`

Set a custom angular constraint axis (have sense only with rotation free minimum along 2 axis).

Set force_update to true if you want to apply the changes right away.

virtual void iJoint::SetBounce | ( | const csVector3 & | bounce,
|  | bool | force_update = `true`
| ) |  | `[pure virtual]`

Set the restitution of the joint's stop point (this is the elasticity of the joint when say throwing open a door how much it will bounce the door back closed when it hits).

virtual void iJoint::SetDesiredVelocity | ( | const csVector3 & | velocity,
|  | bool | force_update = `true`
| ) |  | `[pure virtual]`

Apply a motor velocity to joint (for instance on wheels).

Set force_update to true if you want to apply the changes right away.

virtual void iJoint::SetMaxForce | ( | const csVector3 & | maxForce,
|  | bool | force_update = `true`
| ) |  | `[pure virtual]`

Set the maximum force that can be applied by the joint motor to reach the desired velocity.

Set force_update to true if you want to apply the changes right away.

virtual void iJoint::SetMaximumAngle | ( | const csVector3 & | max,
|  | bool | force_update = `true`
| ) |  | `[pure virtual]`

Set the maximum allowed angle between the two bodies (in radian).

Set force_update to true if you want to apply the changes right away.

virtual void iJoint::SetMaximumDistance | ( | const csVector3 & | max,
|  | bool | force_update = `true`
| ) |  | `[pure virtual]`

Set the maximum allowed distance between the two bodies.

Set force_update to true if you want to apply the changes right away.

virtual void iJoint::SetMinimumAngle | ( | const csVector3 & | min,
|  | bool | force_update = `true`
| ) |  | `[pure virtual]`

Set the minimum allowed angle between the two bodies, in radian.

Set force_update to true if you want to apply the changes right away.

virtual void iJoint::SetMinimumDistance | ( | const csVector3 & | min,
|  | bool | force_update = `true`
| ) |  | `[pure virtual]`

Set the minimum allowed distance between the two bodies.

Set force_update to true if you want to apply the changes right away.

virtual void iJoint::SetRotConstraints | ( | bool | X,
|  | bool | Y,
|  | bool | Z,
|  | bool | force_update = `true`
| ) |  | `[pure virtual]`

Set the rotational constraints on the 3 axes.

If true is passed for an axis then the Joint will constrain all rotation around that axis (ie no motion will be allowed). If false is passed in then all rotation around that axis is free, but bounded by the minimum and maximum angle if set. Set force_update to true if you want to apply the changes right away.

virtual void iJoint::SetTransConstraints | ( | bool | X,
|  | bool | Y,
|  | bool | Z,
|  | bool | force_update = `true`
| ) |  | `[pure virtual]`

Set the translation constraints on the 3 axes.

If true is passed for an axis then the Joint will constrain all motion along that axis (ie no motion will be allowed). If false is passed in then all motion along that axis is free, but bounded by the minimum and maximum distance if set. Set force_update to true if you want to apply the changes right away.

virtual void iJoint::SetTransform | ( | const csOrthoTransform & | trans,
|  | bool | force_update = `true`
| ) |  | `[pure virtual]`

Set the local transformation of the joint, relative to the second body attached.

The position of the constraining axes will be moved to this transform. The default value is the identity matrix, ie the joint placed at the same position than the second body attached.

Set force_update to true if you want to apply the changes right away.

The documentation for this struct was generated from the following file:

- ivaria/dynamics.h