C# Class Universe.Physics.OpenDynamicsEngine.ODEPhysicsScene

Inheritance: Universe.Framework.Physics.PhysicsScene
Afficher le fichier Open project: Virtual-Universe/Virtual-Universe Class Usage Examples

Méthodes publiques

Свойство Type Description
AllowAvGravity bool
AllowAvsToEscapeGravity bool
AllowUnderwaterPhysics bool
AvGravityHeight int
MeshSculptphysicalLOD float
ODE_STEPSIZE float
PID_D float
PID_P float
RegionTerrain System.IntPtr
SimulationChangesQueue ConcurrentQueue
WorldExtents System.Vector2
actor_name_map PhysicsActor>.Dictionary
avCapRadius float
avDensity float
avHeightFudgeFactor float
avMovementDivisorRun float
avMovementDivisorWalk float
bodyFramesAutoDisable int
forceSimplePrimMeshing bool
geomContactPointsStartthrottle int
geomCrossingFailuresBeforeOutofbounds int
gravityVector System.Vector3
gravityVectorNormalized System.Vector3
gravityx float
gravityy float
gravityz float
m_AvFlySpeed float
m_allowJump bool
m_flightCeilingHeight float
m_preJumpForceMultiplierX float
m_preJumpForceMultiplierY float
m_preJumpForceMultiplierZ float
m_preJumpTime int
m_useFlightCeilingHeight bool
m_usepreJump bool
maximumMassObject float
meshSculptLOD float
meshSculptedPrim bool
mesher IMesher
space System.IntPtr
staticPrimspace ].IntPtr[
world System.IntPtr

Protected Properties

Свойство Type Description
AvatarContactBounce float
ContactgeomsArray System.IntPtr
DoPhyWind bool
FrictionMovementMultiplier float
FrictionScale float
GlobalContactsArray System.IntPtr
GridSpaceScaleBits int
HashspaceHigh int
HashspaceLow int
IsLocked bool
ODETerrainHeightFieldHeights float[]
PANull Universe.Framework.Physics.PhysicsActor
RemoveQueue ConcurrentQueue
TerrainHeightFieldHeights short[]
WaterHeight double
_activeprims HashSet
_activeprimsLock object
_characters HashSet
_collisionEventDictionary PhysicsActor>.ConcurrentDictionary
_collisionEventListLock object
_contactcountLock object
_perloopContact List
_prims HashSet
contactgroup System.IntPtr
contactsPerCollision int
contactsurfacelayer float
m_channel ITerrainChannel
m_config IConfigSource
m_currentmaxContactsbeforedeath int
m_filterCollisions bool
m_global_contactcount int
m_physicsiterations int
m_rayCastManager ODERayCastRequestManager
m_region Universe.Framework.SceneInfo.RegionInfo
m_scene IScene
m_timeDilation float
m_windModule IWindModule
minimumGroundFlightOffset float
nearCallback d.NearCallback
newGlobalcontact d.Contact
nspacesPerSideX int
nspacesPerSideY int
step_time float

Méthodes publiques

Méthode Description
AddAvatar ( string avName, System.Vector3 position, Quaternion rotation, System.Vector3 size, bool isFlying, uint localID, UUID UUID ) : PhysicsActor
AddCollisionEventReporting ( PhysicsActor obj ) : void
AddGravityPoint ( bool isApplyingForces, System.Vector3 position, float forceX, float forceY, float forceZ, float gravForce, float radius, int identifier ) : void
AddODECollision ( d curContact, PhysicsActor p1, PhysicsActor p2, IntPtr b1, IntPtr b2, ContactPoint maxDepthContact, int &NotSkipedCount ) : void
AddPrimShape ( UUID primID, uint localID, string name, byte physicsType, PrimitiveBaseShape shape, System.Vector3 position, System.Vector3 size, Quaternion rotation, bool isPhysical, int material, float friction, float restitution, float gravityMultiplier, float density ) : PhysicsActor
AddSimulationChange ( NoParam del ) : void

Called to queue a change to a prim to use in place of old taint mechanism so changes do have a time sequence

CalculateGravity ( float mass, System.Vector3 position, bool allowNormalGravity, float gravityModifier, System.Vector3 &forceVector ) : void
CalculateSpaceArrayItemFromPos ( System.Vector3 pos ) : int[]

Holds the space allocation logic

CalculateSpaceForGeom ( System.Vector3 pos ) : IntPtr

Calculates the space the prim should be in by its position

Collision_optimized ( float timeStep ) : void

This is our collision testing routine in ODE

Dispose ( ) : void
GetContactParam ( float mu, float AvatarContactBounce, d &newGlobalcontact ) : void
GetGravityForce ( ) : float[]
GetTerrainHeightAtXY ( float x, float y ) : float
GetTopColliders ( ) : float>.Dictionary
GetWaterLevel ( float x, float y ) : double
Initialize ( IMesher meshmerizer, IScene scene ) : void
IsNearBody ( IntPtr gspace, IntPtr g1, IntPtr g2 ) : void

This is our near callback. A geometry is near a body

ODEPhysicsScene ( ) : System

Initializes the scene Sets many properties that ODE requires to be stable These settings need to be tweaked 'exactly' right or weird stuff happens.

PostInitialize ( IConfigSource config ) : void
RaycastWorld ( System.Vector3 position, System.Vector3 direction, float length, int Count ) : List
RaycastWorld ( System.Vector3 position, System.Vector3 direction, float length, RaycastCallback retMethod ) : void
RaycastWorld ( System.Vector3 position, System.Vector3 direction, float length, int Count, RayCallback retMethod ) : void
RecalculateSpaceForGeom ( IntPtr geom, System.Vector3 pos, IntPtr currentspace ) : IntPtr

Called when a static prim moves. Allocates a space for the prim based on its position

RemCollisionEventReporting ( PhysicsActor obj ) : void
RemoveAvatar ( PhysicsActor actor ) : void
RemovePrim ( PhysicsActor prim ) : void
SetGravityForce ( bool enabled, float forceX, float forceY, float forceZ ) : void

Sets gravity parameters in the single axis, if you want a point, use the gravity point pieces

SetTerrain ( ITerrainChannel channel, short heightMap ) : void
SetWaterLevel ( double height, short map ) : void
Simulate ( float timeElapsed ) : void

This is our main simulate loop It's thread locked by a Mutex in the scene. It holds Collisions, it instructs ODE to step through the physical reactions It moves the objects around in memory It calls the methods that report back to the object owners.. (scenepresence, SceneObjectGroup)

SupportsRayCast ( ) : bool
WhichSpaceAmIIn ( System.Vector3 pos ) : string

Debug space message for printing the space that a prim/avatar is in.

command ( int cmd ) : void
start ( int unused ) : void
step ( int pause ) : void

Private Methods

Méthode Description
AddActivePrim ( ODEPrim activatePrim ) : void
AddCharacter ( ODECharacter chr ) : void

Adds a character to the list of avatars in the scene Internally locked, as it is called only in the Simulation Changes loop

BadCharacter ( ODECharacter chr ) : void
BadPrim ( ODEPrim universeODEPrim ) : void
CheckDupe ( d contactGeom, int atype ) : bool
Collision_accounting_events ( PhysicsActor p1, PhysicsActor p2, ContactPoint contact ) : void
CreateContacJoint ( d geom ) : IntPtr
GetCurContactGeom ( int index, d &newcontactgeom ) : bool
NeedsMeshing ( ODEPrim prim, byte physicalType ) : bool

Routine to figure out if we need to mesh this prim with our mesher

RemoveActivePrim ( ODEPrim deactivatePrim ) : void
RemoveCharacter ( ODECharacter chr ) : void

Removes a character from the list of avatars currently in the scene Internally locked, as it is called only in the Simulation Changes loop

RemovePrimThreadLocked ( ODEPrim prim ) : void

This is called from within simulate but outside the locked portion We need to do our own locking here Essentially, we need to remove the prim from our space segment, whatever segment it's in. If there are no more prim in the segment, we need to empty (spacedestroy)the segment and reclaim memory that the space was using.

Method Details

AddAvatar() public méthode

public AddAvatar ( string avName, System.Vector3 position, Quaternion rotation, System.Vector3 size, bool isFlying, uint localID, UUID UUID ) : PhysicsActor
avName string
position System.Vector3
rotation Quaternion
size System.Vector3
isFlying bool
localID uint
UUID UUID
Résultat Universe.Framework.Physics.PhysicsActor

AddCollisionEventReporting() public méthode

public AddCollisionEventReporting ( PhysicsActor obj ) : void
obj Universe.Framework.Physics.PhysicsActor
Résultat void

AddGravityPoint() public méthode

public AddGravityPoint ( bool isApplyingForces, System.Vector3 position, float forceX, float forceY, float forceZ, float gravForce, float radius, int identifier ) : void
isApplyingForces bool
position System.Vector3
forceX float
forceY float
forceZ float
gravForce float
radius float
identifier int
Résultat void

AddODECollision() public méthode

public AddODECollision ( d curContact, PhysicsActor p1, PhysicsActor p2, IntPtr b1, IntPtr b2, ContactPoint maxDepthContact, int &NotSkipedCount ) : void
curContact d
p1 Universe.Framework.Physics.PhysicsActor
p2 Universe.Framework.Physics.PhysicsActor
b1 System.IntPtr
b2 System.IntPtr
maxDepthContact Universe.Framework.Physics.ContactPoint
NotSkipedCount int
Résultat void

AddPrimShape() public méthode

public AddPrimShape ( UUID primID, uint localID, string name, byte physicsType, PrimitiveBaseShape shape, System.Vector3 position, System.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 System.Vector3
size System.Vector3
rotation Quaternion
isPhysical bool
material int
friction float
restitution float
gravityMultiplier float
density float
Résultat Universe.Framework.Physics.PhysicsActor

AddSimulationChange() public méthode

Called to queue a change to a prim to use in place of old taint mechanism so changes do have a time sequence
public AddSimulationChange ( NoParam del ) : void
del NoParam
Résultat void

CalculateGravity() public méthode

public CalculateGravity ( float mass, System.Vector3 position, bool allowNormalGravity, float gravityModifier, System.Vector3 &forceVector ) : void
mass float
position System.Vector3
allowNormalGravity bool
gravityModifier float
forceVector System.Vector3
Résultat void

CalculateSpaceArrayItemFromPos() public méthode

Holds the space allocation logic
public CalculateSpaceArrayItemFromPos ( System.Vector3 pos ) : int[]
pos System.Vector3
Résultat int[]

CalculateSpaceForGeom() public méthode

Calculates the space the prim should be in by its position
public CalculateSpaceForGeom ( System.Vector3 pos ) : IntPtr
pos System.Vector3
Résultat System.IntPtr

Collision_optimized() public méthode

This is our collision testing routine in ODE
public Collision_optimized ( float timeStep ) : void
timeStep float
Résultat void

Dispose() public méthode

public Dispose ( ) : void
Résultat void

GetContactParam() public méthode

public GetContactParam ( float mu, float AvatarContactBounce, d &newGlobalcontact ) : void
mu float
AvatarContactBounce float
newGlobalcontact d
Résultat void

GetGravityForce() public méthode

public GetGravityForce ( ) : float[]
Résultat float[]

GetTerrainHeightAtXY() public méthode

public GetTerrainHeightAtXY ( float x, float y ) : float
x float
y float
Résultat float

GetTopColliders() public méthode

public GetTopColliders ( ) : float>.Dictionary
Résultat float>.Dictionary

GetWaterLevel() public méthode

public GetWaterLevel ( float x, float y ) : double
x float
y float
Résultat double

Initialize() public méthode

public Initialize ( IMesher meshmerizer, IScene scene ) : void
meshmerizer IMesher
scene IScene
Résultat void

IsNearBody() public méthode

This is our near callback. A geometry is near a body
public IsNearBody ( IntPtr gspace, IntPtr g1, IntPtr g2 ) : void
gspace System.IntPtr The space that contains the geoms. Remember, spaces are also geoms
g1 System.IntPtr a geometry or space
g2 System.IntPtr another geometry or space
Résultat void

ODEPhysicsScene() public méthode

Initializes the scene Sets many properties that ODE requires to be stable These settings need to be tweaked 'exactly' right or weird stuff happens.
public ODEPhysicsScene ( ) : System
Résultat System

PostInitialize() public méthode

public PostInitialize ( IConfigSource config ) : void
config IConfigSource
Résultat void

RaycastWorld() public méthode

public RaycastWorld ( System.Vector3 position, System.Vector3 direction, float length, int Count ) : List
position System.Vector3
direction System.Vector3
length float
Count int
Résultat List

RaycastWorld() public méthode

public RaycastWorld ( System.Vector3 position, System.Vector3 direction, float length, RaycastCallback retMethod ) : void
position System.Vector3
direction System.Vector3
length float
retMethod RaycastCallback
Résultat void

RaycastWorld() public méthode

public RaycastWorld ( System.Vector3 position, System.Vector3 direction, float length, int Count, RayCallback retMethod ) : void
position System.Vector3
direction System.Vector3
length float
Count int
retMethod RayCallback
Résultat void

RecalculateSpaceForGeom() public méthode

Called when a static prim moves. Allocates a space for the prim based on its position
public RecalculateSpaceForGeom ( IntPtr geom, System.Vector3 pos, IntPtr currentspace ) : IntPtr
geom System.IntPtr The pointer to the geom that moved
pos System.Vector3 The position that the geom moved to
currentspace System.IntPtr A pointer to the space it was in before it was moved.
Résultat System.IntPtr

RemCollisionEventReporting() public méthode

public RemCollisionEventReporting ( PhysicsActor obj ) : void
obj Universe.Framework.Physics.PhysicsActor
Résultat void

RemoveAvatar() public méthode

public RemoveAvatar ( PhysicsActor actor ) : void
actor Universe.Framework.Physics.PhysicsActor
Résultat void

RemovePrim() public méthode

public RemovePrim ( PhysicsActor prim ) : void
prim Universe.Framework.Physics.PhysicsActor
Résultat void

SetGravityForce() public méthode

Sets gravity parameters in the single axis, if you want a point, use the gravity point pieces
public SetGravityForce ( bool enabled, float forceX, float forceY, float forceZ ) : void
enabled bool Enable one axis gravity (disables point gravity)
forceX float
forceY float
forceZ float
Résultat void

SetTerrain() public méthode

public SetTerrain ( ITerrainChannel channel, short heightMap ) : void
channel ITerrainChannel
heightMap short
Résultat void

SetWaterLevel() public méthode

public SetWaterLevel ( double height, short map ) : void
height double
map short
Résultat void

Simulate() public méthode

This is our main simulate loop It's thread locked by a Mutex in the scene. It holds Collisions, it instructs ODE to step through the physical reactions It moves the objects around in memory It calls the methods that report back to the object owners.. (scenepresence, SceneObjectGroup)
public Simulate ( float timeElapsed ) : void
timeElapsed float
Résultat void

SupportsRayCast() public méthode

public SupportsRayCast ( ) : bool
Résultat bool

WhichSpaceAmIIn() public méthode

Debug space message for printing the space that a prim/avatar is in.
public WhichSpaceAmIIn ( System.Vector3 pos ) : string
pos System.Vector3
Résultat string

command() public méthode

public command ( int cmd ) : void
cmd int
Résultat void

start() public méthode

public start ( int unused ) : void
unused int
Résultat void

step() public méthode

public step ( int pause ) : void
pause int
Résultat void

Property Details

AllowAvGravity public_oe property

public bool AllowAvGravity
Résultat bool

AllowAvsToEscapeGravity public_oe property

public bool AllowAvsToEscapeGravity
Résultat bool

AllowUnderwaterPhysics public_oe property

public bool AllowUnderwaterPhysics
Résultat bool

AvGravityHeight public_oe property

public int AvGravityHeight
Résultat int

AvatarContactBounce protected_oe property

protected float AvatarContactBounce
Résultat float

ContactgeomsArray protected_oe property

protected IntPtr,System ContactgeomsArray
Résultat System.IntPtr

DoPhyWind protected_oe property

protected bool DoPhyWind
Résultat bool

FrictionMovementMultiplier protected_oe property

protected float FrictionMovementMultiplier
Résultat float

FrictionScale protected_oe property

protected float FrictionScale
Résultat float

GlobalContactsArray protected_oe property

protected IntPtr,System GlobalContactsArray
Résultat System.IntPtr

GridSpaceScaleBits protected_oe property

protected int GridSpaceScaleBits
Résultat int

HashspaceHigh protected_oe property

protected int HashspaceHigh
Résultat int

HashspaceLow protected_oe property

protected int HashspaceLow
Résultat int

IsLocked protected_oe property

protected bool IsLocked
Résultat bool

MeshSculptphysicalLOD public_oe property

public float MeshSculptphysicalLOD
Résultat float

ODETerrainHeightFieldHeights protected_oe property

protected float[] ODETerrainHeightFieldHeights
Résultat float[]

ODE_STEPSIZE public_oe property

public float ODE_STEPSIZE
Résultat float

PANull protected_oe property

protected PhysicsActor,Universe.Framework.Physics PANull
Résultat Universe.Framework.Physics.PhysicsActor

PID_D public_oe property

public float PID_D
Résultat float

PID_P public_oe property

public float PID_P
Résultat float

RegionTerrain public_oe property

public IntPtr,System RegionTerrain
Résultat System.IntPtr

RemoveQueue protected_oe property

protected ConcurrentQueue RemoveQueue
Résultat ConcurrentQueue

SimulationChangesQueue public_oe property

public ConcurrentQueue SimulationChangesQueue
Résultat ConcurrentQueue

TerrainHeightFieldHeights protected_oe property

protected short[] TerrainHeightFieldHeights
Résultat short[]

WaterHeight protected_oe property

protected double WaterHeight
Résultat double

WorldExtents public_oe property

public Vector2,System WorldExtents
Résultat System.Vector2

_activeprims protected_oe property

protected HashSet _activeprims
Résultat HashSet

_activeprimsLock protected_oe property

protected object _activeprimsLock
Résultat object

_characters protected_oe property

protected HashSet _characters
Résultat HashSet

_collisionEventDictionary protected_oe property

protected ConcurrentDictionary _collisionEventDictionary
Résultat PhysicsActor>.ConcurrentDictionary

_collisionEventListLock protected_oe property

protected object _collisionEventListLock
Résultat object

_contactcountLock protected_oe property

protected object _contactcountLock
Résultat object

_perloopContact protected_oe property

protected List _perloopContact
Résultat List

_prims protected_oe property

protected HashSet _prims
Résultat HashSet

actor_name_map public_oe property

public Dictionary actor_name_map
Résultat PhysicsActor>.Dictionary

avCapRadius public_oe property

public float avCapRadius
Résultat float

avDensity public_oe property

public float avDensity
Résultat float

avHeightFudgeFactor public_oe property

public float avHeightFudgeFactor
Résultat float

avMovementDivisorRun public_oe property

public float avMovementDivisorRun
Résultat float

avMovementDivisorWalk public_oe property

public float avMovementDivisorWalk
Résultat float

bodyFramesAutoDisable public_oe property

public int bodyFramesAutoDisable
Résultat int

contactgroup protected_oe property

protected IntPtr,System contactgroup
Résultat System.IntPtr

contactsPerCollision protected_oe property

protected int contactsPerCollision
Résultat int

contactsurfacelayer protected_oe property

protected float contactsurfacelayer
Résultat float

forceSimplePrimMeshing public_oe property

public bool forceSimplePrimMeshing
Résultat bool

geomContactPointsStartthrottle public_oe property

public int geomContactPointsStartthrottle
Résultat int

geomCrossingFailuresBeforeOutofbounds public_oe property

public int geomCrossingFailuresBeforeOutofbounds
Résultat int

gravityVector public_oe property

public Vector3,System gravityVector
Résultat System.Vector3

gravityVectorNormalized public_oe property

public Vector3,System gravityVectorNormalized
Résultat System.Vector3

gravityx public_oe property

public float gravityx
Résultat float

gravityy public_oe property

public float gravityy
Résultat float

gravityz public_oe property

public float gravityz
Résultat float

m_AvFlySpeed public_oe property

public float m_AvFlySpeed
Résultat float

m_allowJump public_oe property

public bool m_allowJump
Résultat bool

m_channel protected_oe property

protected ITerrainChannel m_channel
Résultat ITerrainChannel

m_config protected_oe property

protected IConfigSource m_config
Résultat IConfigSource

m_currentmaxContactsbeforedeath protected_oe property

protected int m_currentmaxContactsbeforedeath
Résultat int

m_filterCollisions protected_oe property

protected bool m_filterCollisions
Résultat bool

m_flightCeilingHeight public_oe property

public float m_flightCeilingHeight
Résultat float

m_global_contactcount protected_oe property

protected int m_global_contactcount
Résultat int

m_physicsiterations protected_oe property

protected int m_physicsiterations
Résultat int

m_preJumpForceMultiplierX public_oe property

public float m_preJumpForceMultiplierX
Résultat float

m_preJumpForceMultiplierY public_oe property

public float m_preJumpForceMultiplierY
Résultat float

m_preJumpForceMultiplierZ public_oe property

public float m_preJumpForceMultiplierZ
Résultat float

m_preJumpTime public_oe property

public int m_preJumpTime
Résultat int

m_rayCastManager protected_oe property

protected ODERayCastRequestManager,Universe.Physics.OpenDynamicsEngine m_rayCastManager
Résultat ODERayCastRequestManager

m_region protected_oe property

protected RegionInfo,Universe.Framework.SceneInfo m_region
Résultat Universe.Framework.SceneInfo.RegionInfo

m_scene protected_oe property

protected IScene m_scene
Résultat IScene

m_timeDilation protected_oe property

protected float m_timeDilation
Résultat float

m_useFlightCeilingHeight public_oe property

public bool m_useFlightCeilingHeight
Résultat bool

m_usepreJump public_oe property

public bool m_usepreJump
Résultat bool

m_windModule protected_oe property

protected IWindModule m_windModule
Résultat IWindModule

maximumMassObject public_oe property

public float maximumMassObject
Résultat float

meshSculptLOD public_oe property

public float meshSculptLOD
Résultat float

meshSculptedPrim public_oe property

public bool meshSculptedPrim
Résultat bool

mesher public_oe property

public IMesher mesher
Résultat IMesher

minimumGroundFlightOffset protected_oe property

protected float minimumGroundFlightOffset
Résultat float

nearCallback protected_oe property

protected d.NearCallback nearCallback
Résultat d.NearCallback

newGlobalcontact protected_oe property

protected d.Contact,Universe.Physics.OpenDynamicsEngine newGlobalcontact
Résultat d.Contact

nspacesPerSideX protected_oe property

protected int nspacesPerSideX
Résultat int

nspacesPerSideY protected_oe property

protected int nspacesPerSideY
Résultat int

space public_oe property

public IntPtr,System space
Résultat System.IntPtr

staticPrimspace public_oe property

public IntPtr[,] staticPrimspace
Résultat ].IntPtr[

step_time protected_oe property

protected float step_time
Résultat float

world public_oe property

public IntPtr,System world
Résultat System.IntPtr