C# Класс 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.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Описание методов

Activate() публичный абстрактный Метод

public abstract Activate ( ) : void
Результат void

AddContactEntity() публичный абстрактный Метод

public abstract AddContactEntity ( idEntity entity ) : void
entity idEntity
Результат void

AddForce() публичный абстрактный Метод

public abstract AddForce ( int id, Vector3 point, Vector3 force ) : void
id int
point Vector3
force Vector3
Результат void

ApplyImpulse() публичный абстрактный Метод

public abstract ApplyImpulse ( int id, Vector3 point, Vector3 impulse ) : void
id int
point Vector3
impulse Vector3
Результат void

ClearContacts() публичный абстрактный Метод

public abstract ClearContacts ( ) : void
Результат void

ClipContents() публичный абстрактный Метод

public abstract ClipContents ( idClipModel model ) : ContentFlags
model idClipModel
Результат ContentFlags

ClipRotation() публичный абстрактный Метод

public abstract ClipRotation ( idRotation rotation, idClipModel model ) : TraceResult
rotation idRotation
model idClipModel
Результат idTech4.Collision.TraceResult

ClipTranslation() публичный абстрактный Метод

public abstract ClipTranslation ( Vector3 translation, idClipModel model ) : TraceResult
translation Vector3
model idClipModel
Результат idTech4.Collision.TraceResult

DisableClip() публичный абстрактный Метод

Disable the clip models contained by this physics object.
public abstract DisableClip ( ) : void
Результат void

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

protected Dispose ( bool disposing ) : void
disposing bool
Результат void

EnableClip() публичный абстрактный Метод

Enable the clip models contained by this physics object.
public abstract EnableClip ( ) : void
Результат void

Evaluate() публичный абстрактный Метод

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
Результат bool

EvaluateContacts() публичный абстрактный Метод

public abstract EvaluateContacts ( ) : bool
Результат bool

GetAbsoluteBounds() публичный абстрактный Метод

Get the bounds of a specific clip model or the whole physics object.
public abstract GetAbsoluteBounds ( int id = -1 ) : idBounds
id int
Результат idBounds

GetAngularVelocity() публичный абстрактный Метод

public abstract GetAngularVelocity ( int id ) : Vector3
id int
Результат Vector3

GetAxis() публичный абстрактный Метод

public abstract GetAxis ( int id ) : Matrix
id int
Результат Matrix

GetBounds() публичный абстрактный Метод

Get the bounds of a specific clip model or the whole physics object.
public abstract GetBounds ( int id = -1 ) : idBounds
id int
Результат idBounds

GetClipMask() публичный абстрактный Метод

Get the contents a specific clip model or the whole physics object collides with.
public abstract GetClipMask ( int id = -1 ) : ContentFlags
id int
Результат ContentFlags

GetClipModel() публичный абстрактный Метод

public abstract GetClipModel ( int id ) : idClipModel
id int
Результат idClipModel

GetContact() публичный абстрактный Метод

public abstract GetContact ( int index ) : ContactInfo
index int
Результат idTech4.Collision.ContactInfo

GetContents() публичный абстрактный Метод

Get the contents of a specific clip model or the whole physics object.
public abstract GetContents ( int id = -1 ) : ContentFlags
id int
Результат ContentFlags

GetImpactInfo() публичный абстрактный Метод

public abstract GetImpactInfo ( int id, Vector3 point ) : ImpactInfo
id int
point Vector3
Результат ImpactInfo

GetLinearVelocity() публичный абстрактный Метод

public abstract GetLinearVelocity ( int id ) : Vector3
id int
Результат Vector3

GetMass() публичный абстрактный Метод

Get the mass of a specific clip model or the whole physics object.
public abstract GetMass ( int id = -1 ) : float
id int
Результат float

GetOrigin() публичный абстрактный Метод

public abstract GetOrigin ( int id ) : Vector3
id int
Результат Vector3

GetPushedAngularVelocity() публичный абстрактный Метод

public abstract GetPushedAngularVelocity ( int id ) : Vector3
id int
Результат Vector3

GetPushedLinearVelocity() публичный абстрактный Метод

public abstract GetPushedLinearVelocity ( int id ) : Vector3
id int
Результат Vector3

IsGroundClipModel() публичный абстрактный Метод

public abstract IsGroundClipModel ( int index, int id ) : bool
index int
id int
Результат bool

IsGroundEntity() публичный абстрактный Метод

public abstract IsGroundEntity ( int index ) : bool
index int
Результат bool

LinkClip() публичный абстрактный Метод

Link the clip models contained by this physics object.
public abstract LinkClip ( ) : void
Результат void

PutToRest() публичный абстрактный Метод

public abstract PutToRest ( ) : void
Результат void

ReadFromSnapshot() публичный абстрактный Метод

public abstract ReadFromSnapshot ( idBitMsgDelta msg ) : void
msg idBitMsgDelta
Результат void

RemoveContactEntity() публичный абстрактный Метод

public abstract RemoveContactEntity ( idEntity entity ) : void
entity idEntity
Результат void

Restore() публичный Метод

public Restore ( object saveFile ) : void
saveFile object
Результат void

RestoreState() публичный абстрактный Метод

public abstract RestoreState ( ) : void
Результат void

Rotate() публичный абстрактный Метод

Rotate the physics object in world space.
public abstract Rotate ( idRotation rotation, int id = 1 ) : void
rotation idRotation
id int
Результат void

Save() публичный Метод

public Save ( object saveFile ) : void
saveFile object
Результат void

SaveState() публичный абстрактный Метод

public abstract SaveState ( ) : void
Результат void

SetAngularVelocity() публичный абстрактный Метод

public abstract SetAngularVelocity ( Vector3 velocity, int id ) : void
velocity Vector3
id int
Результат void

SetAxis() публичный абстрактный Метод

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
Результат void

SetClipBox() публичный Метод

public SetClipBox ( idBounds bounds, float density ) : void
bounds idBounds
density float
Результат void

SetClipMask() публичный абстрактный Метод

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
Результат void

SetClipModel() публичный абстрактный Метод

public abstract SetClipModel ( idClipModel model, float density, int id, bool disposeOld = true ) : void
model idClipModel
density float
id int
disposeOld bool
Результат void

SetContents() публичный абстрактный Метод

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
Результат void

SetLinearVelocity() публичный абстрактный Метод

public abstract SetLinearVelocity ( Vector3 velocity, int id ) : void
velocity Vector3
id int
Результат void

SetMass() публичный абстрактный Метод

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
Результат void

SetMaster() публичный абстрактный Метод

public abstract SetMaster ( idEntity master, bool orientated = true ) : void
master idEntity
orientated bool
Результат void

SetOrigin() публичный абстрактный Метод

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
Результат void

SetPushed() публичный абстрактный Метод

public abstract SetPushed ( int deltaTime ) : void
deltaTime int
Результат void

SnapTimeToPhysicsFrame() публичный статический Метод

public static SnapTimeToPhysicsFrame ( int t ) : int
t int
Результат int

Translate() публичный абстрактный Метод

Translate the physics object in world space.
public abstract Translate ( Vector3 translation, int id = -1 ) : void
translation Vector3
id int
Результат void

UnlinkClip() публичный абстрактный Метод

Unlink the clip models contained by this physics object.
public abstract UnlinkClip ( ) : void
Результат void

UpdateTime() публичный абстрактный Метод

Update the time without moving.
public abstract UpdateTime ( int endTime ) : void
endTime int
Результат void

WriteToSnapshot() публичный абстрактный Метод

public abstract WriteToSnapshot ( idBitMsgDelta msg ) : void
msg idBitMsgDelta
Результат void

idPhysics() публичный Метод

public idPhysics ( ) : System
Результат System