C# Class Universe.Framework.Physics.PhysicsScene

Show file Open project: Virtual-Universe/Virtual-Universe Class Usage Examples

Public Methods

Method Description
AddAvatar ( string avName, Vector3 position, Quaternion rotation, Vector3 size, bool isFlying, uint localID, UUID uuid ) : PhysicsActor
AddGravityPoint ( bool isApplyingForces, Vector3 position, float forceX, float forceY, float forceZ, float gravForce, float radius, int identifier ) : void
AddPrimShape ( UUID primID, uint localID, string name, byte physicsType, PrimitiveBaseShape shape, Vector3 position, Vector3 size, Quaternion rotation, bool isPhysical, int material, float friction, float restitution, float gravityMultiplier, float density ) : PhysicsActor
Dispose ( ) : void
GetGravityForce ( ) : float[]
GetResults ( ) : void
GetTopColliders ( ) : float>.Dictionary
Initialize ( IMesher meshmerizer, IScene scene ) : void
PostInitialize ( IConfigSource config ) : void
RaycastWorld ( Vector3 position, Vector3 direction, float length, int Count ) : List
RaycastWorld ( Vector3 position, Vector3 direction, float length, RaycastCallback retMethod ) : void

Queue a raycast against the physics scene. The provided callback method will be called when the raycast is complete Many physics engines don't support collision testing at the same time as manipulating the physics scene, so we queue the request up and callback a custom method when the raycast is complete. This allows physics engines that give an immediate result to callback immediately and ones that don't, to callback when it gets a result back. ODE for example will not allow you to change the scene while collision testing or it asserts, 'opteration not valid for locked space'. This includes adding a ray to the scene. This is named RayCastWorld to not conflict with modrex's Raycast method.

RaycastWorld ( Vector3 position, Vector3 direction, float length, int Count, RayCallback retMethod ) : void
RemoveAvatar ( PhysicsActor actor ) : void
RemovePrim ( PhysicsActor prim ) : void

Removes a single prim from the group that it is in (or removes it entirely from the scene if it is as single prim)

SetGravityForce ( bool enabled, float forceX, float forceY, float forceZ ) : void
SetTerrain ( ITerrainChannel channel, short heightMap ) : void
SetWaterLevel ( double height, short map ) : void
Simulate ( float timeStep ) : void
SupportsRayCast ( ) : bool

True if the physics plugin supports raycasting against the physics scene

UpdatesLoop ( ) : void

Method Details

AddAvatar() public abstract method

public abstract AddAvatar ( string avName, Vector3 position, Quaternion rotation, Vector3 size, bool isFlying, uint localID, UUID uuid ) : PhysicsActor
avName string
position Vector3
rotation Quaternion
size Vector3
isFlying bool
localID uint
uuid UUID
return PhysicsActor

AddGravityPoint() public method

public AddGravityPoint ( bool isApplyingForces, Vector3 position, float forceX, float forceY, float forceZ, float gravForce, float radius, int identifier ) : void
isApplyingForces bool
position Vector3
forceX float
forceY float
forceZ float
gravForce float
radius float
identifier int
return void

AddPrimShape() public abstract method

public abstract AddPrimShape ( UUID primID, uint localID, string name, byte physicsType, PrimitiveBaseShape shape, Vector3 position, Vector3 size, Quaternion rotation, bool isPhysical, int material, float friction, float restitution, float gravityMultiplier, float density ) : PhysicsActor
primID UUID
localID uint
name string
physicsType byte
shape PrimitiveBaseShape
position Vector3
size Vector3
rotation Quaternion
isPhysical bool
material int
friction float
restitution float
gravityMultiplier float
density float
return PhysicsActor

Dispose() public abstract method

public abstract Dispose ( ) : void
return void

GetGravityForce() public method

public GetGravityForce ( ) : float[]
return float[]

GetResults() public method

public GetResults ( ) : void
return void

GetTopColliders() public abstract method

public abstract GetTopColliders ( ) : float>.Dictionary
return float>.Dictionary

Initialize() public abstract method

public abstract Initialize ( IMesher meshmerizer, IScene scene ) : void
meshmerizer IMesher
scene IScene
return void

PostInitialize() public abstract method

public abstract PostInitialize ( IConfigSource config ) : void
config IConfigSource
return void

RaycastWorld() public method

public RaycastWorld ( Vector3 position, Vector3 direction, float length, int Count ) : List
position Vector3
direction Vector3
length float
Count int
return List

RaycastWorld() public method

Queue a raycast against the physics scene. The provided callback method will be called when the raycast is complete Many physics engines don't support collision testing at the same time as manipulating the physics scene, so we queue the request up and callback a custom method when the raycast is complete. This allows physics engines that give an immediate result to callback immediately and ones that don't, to callback when it gets a result back. ODE for example will not allow you to change the scene while collision testing or it asserts, 'opteration not valid for locked space'. This includes adding a ray to the scene. This is named RayCastWorld to not conflict with modrex's Raycast method.
public RaycastWorld ( Vector3 position, Vector3 direction, float length, RaycastCallback retMethod ) : void
position Vector3 Origin of the ray
direction Vector3 Direction of the ray
length float Length of ray in meters
retMethod RaycastCallback Method to call when the raycast is complete
return void

RaycastWorld() public method

public RaycastWorld ( Vector3 position, Vector3 direction, float length, int Count, RayCallback retMethod ) : void
position Vector3
direction Vector3
length float
Count int
retMethod RayCallback
return void

RemoveAvatar() public abstract method

public abstract RemoveAvatar ( PhysicsActor actor ) : void
actor PhysicsActor
return void

RemovePrim() public abstract method

Removes a single prim from the group that it is in (or removes it entirely from the scene if it is as single prim)
public abstract RemovePrim ( PhysicsActor prim ) : void
prim PhysicsActor
return void

SetGravityForce() public method

public SetGravityForce ( bool enabled, float forceX, float forceY, float forceZ ) : void
enabled bool
forceX float
forceY float
forceZ float
return void

SetTerrain() public abstract method

public abstract SetTerrain ( ITerrainChannel channel, short heightMap ) : void
channel ITerrainChannel
heightMap short
return void

SetWaterLevel() public abstract method

public abstract SetWaterLevel ( double height, short map ) : void
height double
map short
return void

Simulate() public abstract method

public abstract Simulate ( float timeStep ) : void
timeStep float
return void

SupportsRayCast() public method

True if the physics plugin supports raycasting against the physics scene
public SupportsRayCast ( ) : bool
return bool

UpdatesLoop() public method

public UpdatesLoop ( ) : void
return void