C# Class idTech4.Game.Physics.idPhysics

Physics abstract class.
A physics object is a tool to manipulate the position and orientation of an entity. The physics object is a container for idClipModels used for collision detection. The physics deals with moving these collision models through the world according to the laws of physics or other rules. The mass of a clip model is the volume of the clip model times the density. An arbitrary mass can however be set for specific clip models or the whole physics object. The contents of a clip model is a set of bit flags that define the contents. The clip mask defines the contents a clip model collides with. The linear velocity of a physics object is a vector that defines the translation of the center of mass in units per second. The angular velocity of a physics object is a vector that passes through the center of mass. The direction of this vector defines the axis of rotation and the magnitude defines the rate of rotation about the axis in radians per second. The gravity is the change in velocity per second due to gravitational force. Entities update their visual position and orientation from the physics using GetOrigin() and GetAxis(). Direct origin and axis changes of entities should go through the physics. In other words the physics origin and axis are updated first and the entity updates it's visual position from the physics.
Inheritance: IDisposable
Mostrar archivo Open project: iainmckay/idtech4.net Class Usage Examples

Public Methods

Method Description
Activate ( ) : void
AddContactEntity ( idEntity entity ) : void
AddForce ( int id, Vector3 point, Vector3 force ) : void
ApplyImpulse ( int id, Vector3 point, Vector3 impulse ) : void
ClearContacts ( ) : void
ClipContents ( idClipModel model ) : ContentFlags
ClipRotation ( idRotation rotation, idClipModel model ) : TraceResult
ClipTranslation ( Vector3 translation, idClipModel model ) : TraceResult
DisableClip ( ) : void

Disable the clip models contained by this physics object.

Dispose ( ) : void
EnableClip ( ) : void

Enable the clip models contained by this physics object.

Evaluate ( int timeStep, int endTime ) : bool

Evaluate the physics with the given time step, returns true if the object moved.

EvaluateContacts ( ) : bool
GetAbsoluteBounds ( int id = -1 ) : idBounds

Get the bounds of a specific clip model or the whole physics object.

GetAngularVelocity ( int id ) : Vector3
GetAxis ( int id ) : Matrix
GetBounds ( int id = -1 ) : idBounds

Get the bounds of a specific clip model or the whole physics object.

GetClipMask ( int id = -1 ) : ContentFlags

Get the contents a specific clip model or the whole physics object collides with.

GetClipModel ( int id ) : idClipModel
GetContact ( int index ) : ContactInfo
GetContents ( int id = -1 ) : ContentFlags

Get the contents of a specific clip model or the whole physics object.

GetImpactInfo ( int id, Vector3 point ) : ImpactInfo
GetLinearVelocity ( int id ) : Vector3
GetMass ( int id = -1 ) : float

Get the mass of a specific clip model or the whole physics object.

GetOrigin ( int id ) : Vector3
GetPushedAngularVelocity ( int id ) : Vector3
GetPushedLinearVelocity ( int id ) : Vector3
IsGroundClipModel ( int index, int id ) : bool
IsGroundEntity ( int index ) : bool
LinkClip ( ) : void

Link the clip models contained by this physics object.

PutToRest ( ) : void
ReadFromSnapshot ( idBitMsgDelta msg ) : void
RemoveContactEntity ( idEntity entity ) : void
Restore ( object saveFile ) : void
RestoreState ( ) : void
Rotate ( idRotation rotation, int id = 1 ) : void

Rotate the physics object in world space.

Save ( object saveFile ) : void
SaveState ( ) : void
SetAngularVelocity ( Vector3 velocity, int id ) : void
SetAxis ( Matrix axis, int id = -1 ) : void

Set the orientation in master space or world space if no master set.

SetClipBox ( idBounds bounds, float density ) : void
SetClipMask ( ContentFlags mask, int id = -1 ) : void

Set the contents a specific clip model or the whole physics object collides with.

SetClipModel ( idClipModel model, float density, int id, bool disposeOld = true ) : void
SetContents ( ContentFlags contents, int id = -1 ) : void

Set the contents of a specific clip model or the whole physics object.

SetLinearVelocity ( Vector3 velocity, int id ) : void
SetMass ( float mass, int id = -1 ) : void

Set the mass of a specific clip model or the whole physics object.

SetMaster ( idEntity master, bool orientated = true ) : void
SetOrigin ( Vector3 origin, int id = -1 ) : void

Set the position in master space or world space if no master set.

SetPushed ( int deltaTime ) : void
SnapTimeToPhysicsFrame ( int t ) : int
Translate ( Vector3 translation, int id = -1 ) : void

Translate the physics object in world space.

UnlinkClip ( ) : void

Unlink the clip models contained by this physics object.

UpdateTime ( int endTime ) : void

Update the time without moving.

WriteToSnapshot ( idBitMsgDelta msg ) : void
idPhysics ( ) : System

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Method Details

Activate() public abstract method

public abstract Activate ( ) : void
return void

AddContactEntity() public abstract method

public abstract AddContactEntity ( idEntity entity ) : void
entity idEntity
return void

AddForce() public abstract method

public abstract AddForce ( int id, Vector3 point, Vector3 force ) : void
id int
point Vector3
force Vector3
return void

ApplyImpulse() public abstract method

public abstract ApplyImpulse ( int id, Vector3 point, Vector3 impulse ) : void
id int
point Vector3
impulse Vector3
return void

ClearContacts() public abstract method

public abstract ClearContacts ( ) : void
return void

ClipContents() public abstract method

public abstract ClipContents ( idClipModel model ) : ContentFlags
model idClipModel
return ContentFlags

ClipRotation() public abstract method

public abstract ClipRotation ( idRotation rotation, idClipModel model ) : TraceResult
rotation idRotation
model idClipModel
return idTech4.Collision.TraceResult

ClipTranslation() public abstract method

public abstract ClipTranslation ( Vector3 translation, idClipModel model ) : TraceResult
translation Vector3
model idClipModel
return idTech4.Collision.TraceResult

DisableClip() public abstract method

Disable the clip models contained by this physics object.
public abstract DisableClip ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

EnableClip() public abstract method

Enable the clip models contained by this physics object.
public abstract EnableClip ( ) : void
return void

Evaluate() public abstract method

Evaluate the physics with the given time step, returns true if the object moved.
public abstract Evaluate ( int timeStep, int endTime ) : bool
timeStep int
endTime int
return bool

EvaluateContacts() public abstract method

public abstract EvaluateContacts ( ) : bool
return bool

GetAbsoluteBounds() public abstract method

Get the bounds of a specific clip model or the whole physics object.
public abstract GetAbsoluteBounds ( int id = -1 ) : idBounds
id int
return idBounds

GetAngularVelocity() public abstract method

public abstract GetAngularVelocity ( int id ) : Vector3
id int
return Vector3

GetAxis() public abstract method

public abstract GetAxis ( int id ) : Matrix
id int
return Matrix

GetBounds() public abstract method

Get the bounds of a specific clip model or the whole physics object.
public abstract GetBounds ( int id = -1 ) : idBounds
id int
return idBounds

GetClipMask() public abstract method

Get the contents a specific clip model or the whole physics object collides with.
public abstract GetClipMask ( int id = -1 ) : ContentFlags
id int
return ContentFlags

GetClipModel() public abstract method

public abstract GetClipModel ( int id ) : idClipModel
id int
return idClipModel

GetContact() public abstract method

public abstract GetContact ( int index ) : ContactInfo
index int
return idTech4.Collision.ContactInfo

GetContents() public abstract method

Get the contents of a specific clip model or the whole physics object.
public abstract GetContents ( int id = -1 ) : ContentFlags
id int
return ContentFlags

GetImpactInfo() public abstract method

public abstract GetImpactInfo ( int id, Vector3 point ) : ImpactInfo
id int
point Vector3
return ImpactInfo

GetLinearVelocity() public abstract method

public abstract GetLinearVelocity ( int id ) : Vector3
id int
return Vector3

GetMass() public abstract method

Get the mass of a specific clip model or the whole physics object.
public abstract GetMass ( int id = -1 ) : float
id int
return float

GetOrigin() public abstract method

public abstract GetOrigin ( int id ) : Vector3
id int
return Vector3

GetPushedAngularVelocity() public abstract method

public abstract GetPushedAngularVelocity ( int id ) : Vector3
id int
return Vector3

GetPushedLinearVelocity() public abstract method

public abstract GetPushedLinearVelocity ( int id ) : Vector3
id int
return Vector3

IsGroundClipModel() public abstract method

public abstract IsGroundClipModel ( int index, int id ) : bool
index int
id int
return bool

IsGroundEntity() public abstract method

public abstract IsGroundEntity ( int index ) : bool
index int
return bool

LinkClip() public abstract method

Link the clip models contained by this physics object.
public abstract LinkClip ( ) : void
return void

PutToRest() public abstract method

public abstract PutToRest ( ) : void
return void

ReadFromSnapshot() public abstract method

public abstract ReadFromSnapshot ( idBitMsgDelta msg ) : void
msg idBitMsgDelta
return void

RemoveContactEntity() public abstract method

public abstract RemoveContactEntity ( idEntity entity ) : void
entity idEntity
return void

Restore() public method

public Restore ( object saveFile ) : void
saveFile object
return void

RestoreState() public abstract method

public abstract RestoreState ( ) : void
return void

Rotate() public abstract method

Rotate the physics object in world space.
public abstract Rotate ( idRotation rotation, int id = 1 ) : void
rotation idRotation
id int
return void

Save() public method

public Save ( object saveFile ) : void
saveFile object
return void

SaveState() public abstract method

public abstract SaveState ( ) : void
return void

SetAngularVelocity() public abstract method

public abstract SetAngularVelocity ( Vector3 velocity, int id ) : void
velocity Vector3
id int
return void

SetAxis() public abstract method

Set the orientation in master space or world space if no master set.
public abstract SetAxis ( Matrix axis, int id = -1 ) : void
axis Matrix
id int
return void

SetClipBox() public method

public SetClipBox ( idBounds bounds, float density ) : void
bounds idBounds
density float
return void

SetClipMask() public abstract method

Set the contents a specific clip model or the whole physics object collides with.
public abstract SetClipMask ( ContentFlags mask, int id = -1 ) : void
mask ContentFlags
id int
return void

SetClipModel() public abstract method

public abstract SetClipModel ( idClipModel model, float density, int id, bool disposeOld = true ) : void
model idClipModel
density float
id int
disposeOld bool
return void

SetContents() public abstract method

Set the contents of a specific clip model or the whole physics object.
public abstract SetContents ( ContentFlags contents, int id = -1 ) : void
contents ContentFlags
id int
return void

SetLinearVelocity() public abstract method

public abstract SetLinearVelocity ( Vector3 velocity, int id ) : void
velocity Vector3
id int
return void

SetMass() public abstract method

Set the mass of a specific clip model or the whole physics object.
public abstract SetMass ( float mass, int id = -1 ) : void
mass float
id int
return void

SetMaster() public abstract method

public abstract SetMaster ( idEntity master, bool orientated = true ) : void
master idEntity
orientated bool
return void

SetOrigin() public abstract method

Set the position in master space or world space if no master set.
public abstract SetOrigin ( Vector3 origin, int id = -1 ) : void
origin Vector3
id int
return void

SetPushed() public abstract method

public abstract SetPushed ( int deltaTime ) : void
deltaTime int
return void

SnapTimeToPhysicsFrame() public static method

public static SnapTimeToPhysicsFrame ( int t ) : int
t int
return int

Translate() public abstract method

Translate the physics object in world space.
public abstract Translate ( Vector3 translation, int id = -1 ) : void
translation Vector3
id int
return void

UnlinkClip() public abstract method

Unlink the clip models contained by this physics object.
public abstract UnlinkClip ( ) : void
return void

UpdateTime() public abstract method

Update the time without moving.
public abstract UpdateTime ( int endTime ) : void
endTime int
return void

WriteToSnapshot() public abstract method

public abstract WriteToSnapshot ( idBitMsgDelta msg ) : void
msg idBitMsgDelta
return void

idPhysics() public method

public idPhysics ( ) : System
return System