## Public API Reference

- Main Page
- Classes
- Files

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# iPcGravity Struct Reference

Gravity handling property class. More...

`#include <propclass/gravity.h>`

List of all members.

## Public Member Functions

virtual void | ApplyForce (const csVector3 &force, float time)=0
| Apply a non-permanent force.
virtual void | ApplyPermanentForce (const csVector3 &force)=0
| Apply an permanent force.
virtual void | ClearForces ()=0
| Clear all non-permanent forces.
virtual void | ClearPermanentForces ()=0
| Clear all permanent forces.
virtual void | CreateGravityCollider (const csVector3 &dim, const csVector3 &offs)=0
| Create a gravity collider with the specified dimensions.
virtual void | CreateGravityCollider (iPcMesh *mesh)=0
| Create a gravity collider from the given mesh.
virtual iCollider * | GetGravityCollider ()=0
| Get the gravity collider.
virtual iPcMovable * | GetMovable ()=0
| Get the current movable.
virtual iPcSolid * | GetSolid ()=0
| Get the current solid.
virtual float | GetWeight () const =0
| Get the weight of this object.
virtual bool | IsActive () const =0
| Check activation status.
virtual bool | IsResting () const =0
| Return true if object is resting.
virtual void | ResetSpeed ()=0
| Reset speed (but leave forces alone).
virtual void | SetActive (bool activate)=0
| Activate/deactivate physics handling for this object.
virtual void | SetMovable (iPcMovable *movable)=0
| Set the movable on which we will operate.
virtual void | SetSolid (iPcSolid *solid)=0
| Set the solid representation which we will additionally use for collision detection.
virtual void | SetWeight (float w)=0
| Set the weight of this object.

## Detailed Description

Gravity handling property class.

This property class supports the following actions (add prefix 'cel.action.' to get the ID of the action and add prefix 'cel.parameter.' to get the ID of the parameter):

- ApplyPermanentForce: parameters 'force' (csVector3).

This property class supports the following properties (add prefix 'cel.property.' to get the ID of the property):

- weight (float, read/write): the weight of the object.

Definition at line 50 of file gravity.h.

## Member Function Documentation

virtual void iPcGravity::ApplyForce | ( | const csVector3 & | force,
|  | float | time
| ) | `[pure virtual]`

| Apply a non-permanent force.

virtual void iPcGravity::ApplyPermanentForce | ( | const csVector3 & | force | ) | `[pure virtual]`

| Apply an permanent force.

virtual void iPcGravity::ClearForces | ( |  | ) | `[pure virtual]`

| Clear all non-permanent forces.

virtual void iPcGravity::ClearPermanentForces | ( |  | ) | `[pure virtual]`

| Clear all permanent forces.

virtual void iPcGravity::CreateGravityCollider | ( | const csVector3 & | dim,
|  | const csVector3 & | offs
| ) | `[pure virtual]`

| Create a gravity collider with the specified dimensions.

virtual void iPcGravity::CreateGravityCollider | ( | iPcMesh * | mesh | ) | `[pure virtual]`

| Create a gravity collider from the given mesh. A gravity collider is a small box at the bottom of the mesh.

virtual iCollider* iPcGravity::GetGravityCollider | ( |  | ) | `[pure virtual]`

| Get the gravity collider. If this returns 0 we have no gravity collider.

virtual iPcMovable* iPcGravity::GetMovable | ( |  | ) | `[pure virtual]`

| Get the current movable.

virtual iPcSolid* iPcGravity::GetSolid | ( |  | ) | `[pure virtual]`

| Get the current solid.

virtual float iPcGravity::GetWeight | ( |  | ) | const`[pure virtual]`

| Get the weight of this object.

virtual bool iPcGravity::IsActive | ( |  | ) | const`[pure virtual]`

| Check activation status.

virtual bool iPcGravity::IsResting | ( |  | ) | const`[pure virtual]`

| Return true if object is resting. This happens when the object did not move the last time physics was checked.

virtual void iPcGravity::ResetSpeed | ( |  | ) | `[pure virtual]`

| Reset speed (but leave forces alone).

virtual void iPcGravity::SetActive | ( | bool | activate | ) | `[pure virtual]`

| Activate/deactivate physics handling for this object.

virtual void iPcGravity::SetMovable | ( | iPcMovable * | movable | ) | `[pure virtual]`

| Set the movable on which we will operate. If not set then a default movable will be found and used instead.

virtual void iPcGravity::SetSolid | ( | iPcSolid * | solid | ) | `[pure virtual]`

| Set the solid representation which we will additionally use for collision detection. If not set then we will find the default solid.

virtual void iPcGravity::SetWeight | ( | float | w | ) | `[pure virtual]`

| Set the weight of this object.

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

- propclass/gravity.h