C# Class OpenSim.Region.Physics.OdePlugin.OdeScene

Inheritance: PhysicsScene
Afficher le fichier Open project: N3X15/VoxelSim Class Usage Examples

Méthodes publiques

Свойство Type Description
MeshSculptphysicalLOD float
OdeLock Object
WorldExtents System.Vector2
actor_name_map PhysicsActor>.Dictionary
bodyFramesAutoDisable int
bodyMotorJointMaxforceTensor float
bodyPIDD float
bodyPIDG float
forceSimplePrimMeshing bool
geomContactPointsStartthrottle int
geomCrossingFailuresBeforeOutofbounds int
geomDefaultDensity float
geomUpdatesPerThrottledUpdate int
geom_name_map String>.Dictionary
gravityx float
gravityy float
gravityz float
hpr Ode.NET.d.Vector3
maximumMassObject float
meshSculptLOD float
meshSculptedPrim bool
mesher IMesher
physics_logging bool
physics_logging_append_existing_logfile bool
physics_logging_interval int
space IntPtr
staticPrimspace ].IntPtr[
triArrayCallback d.TriArrayCallback
triCallback d.TriCallback
voxmesher IVoxelMesher
world IntPtr
xyz d.Vector3

Méthodes publiques

Méthode Description
AddAvatar ( string avName, System.Vector3 position, System.Vector3 size, bool isFlying ) : PhysicsActor
AddCharacter ( OpenSim.Region.Physics.OdePlugin.OdeCharacter chr ) : void
AddPhysicsActorTaint ( PhysicsActor prim ) : void

Called after our prim properties are set Scale, position etc. We use this event queue like method to keep changes to the physical scene occuring in the threadlocked mutex This assures us that we have no race conditions

AddPrimShape ( string primName, OpenSim.Framework.PrimitiveBaseShape pbs, System.Vector3 position, System.Vector3 size, Quaternion rotation ) : PhysicsActor
AddPrimShape ( string primName, OpenSim.Framework.PrimitiveBaseShape pbs, System.Vector3 position, System.Vector3 size, Quaternion rotation, bool isPhysical ) : PhysicsActor
BadCharacter ( OpenSim.Region.Physics.OdePlugin.OdeCharacter chr ) : void
Combine ( PhysicsScene pScene, System.Vector3 offset, System.Vector3 extents ) : void
DeleteTerrain ( ) : void
Dispose ( ) : void
DumpJointInfo ( ) : void
GetJointAnchor ( OpenSim.Region.Physics.Manager.PhysicsJoint joint ) : System.Vector3
GetJointAxis ( OpenSim.Region.Physics.Manager.PhysicsJoint joint ) : System.Vector3
GetResults ( ) : void
GetTerrainHeightAtXY ( float x, float y ) : float
GetTopColliders ( ) : float>.Dictionary
GetWaterLevel ( ) : float
Initialise ( IMesher meshmerizer, IVoxelMesher voxmesh, IConfigSource config ) : void
OdeScene ( OpenSim.Region.Physics.Manager.CollisionLocker dode, string sceneIdentifier ) : System

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

RaycastWorld ( System.Vector3 position, System.Vector3 direction, float length, RaycastCallback retMethod ) : void
RemoveAllJointsConnectedToActorThreadLocked ( PhysicsActor actor ) : void
RemoveAvatar ( PhysicsActor actor ) : void
RemoveCharacter ( OpenSim.Region.Physics.OdePlugin.OdeCharacter chr ) : void
RemovePrim ( PhysicsActor prim ) : void
RemovePrimThreadLocked ( OpenSim.Region.Physics.OdePlugin.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.

RequestJointCreation ( string objectNameInScene, PhysicsJointType jointType, System.Vector3 position, Quaternion rotation, string parms, List bodyNames, string trackedBodyName, Quaternion localRotation ) : OpenSim.Region.Physics.Manager.PhysicsJoint
RequestJointDeletion ( string ObjectNameInScene ) : void
ResizeTerrain512Interpolation ( float heightMap ) : float[]
ResizeTerrain512NearestNeighbour ( float heightMap ) : float[]
SetTerrain ( bool voxmap ) : void
SetTerrain ( bool voxmap, System.Vector3 pOffset ) : void
SetWaterLevel ( float baseheight ) : void
Simulate ( float timeStep ) : float

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)

SupportsCombining ( ) : bool
SupportsRayCast ( ) : bool
TriArrayCallback ( IntPtr trimesh, IntPtr refObject, int triangleIndex, int triCount ) : int
TriCallback ( IntPtr trimesh, IntPtr refObject, int triangleIndex ) : int
UnCombine ( PhysicsScene pScene ) : void
addActivePrim ( OpenSim.Region.Physics.OdePlugin.OdePrim activatePrim ) : void
addCollisionEventReporting ( PhysicsActor obj ) : 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

command ( int cmd ) : void
createprimspace ( int iprimspaceArrItemX, int iprimspaceArrItemY ) : IntPtr

Creates a new space at X Y

needsMeshing ( OpenSim.Framework.PrimitiveBaseShape pbs ) : bool

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

randomizeWater ( float baseheight ) : void
recalculateSpaceForGeom ( IntPtr geom, Vector3 pos, IntPtr currentspace ) : IntPtr

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

remActivePrim ( OdePrim deactivatePrim ) : void
remCollisionEventReporting ( PhysicsActor obj ) : void
resetSpaceArrayItemToZero ( IntPtr pSpace ) : void

Takes a space pointer and zeros out the array we're using to hold the spaces

resetSpaceArrayItemToZero ( int arrayitemX, int arrayitemY ) : void
start ( int unused ) : void
startvisualization ( object o ) : void
step ( int pause ) : void
whichspaceamIin ( Vector3 pos ) : string

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

Private Methods

Méthode Description
AddPrim ( String name, System.Vector3 position, System.Vector3 size, Quaternion rotation, IMesh mesh, OpenSim.Framework.PrimitiveBaseShape pbs, bool isphysical ) : PhysicsActor
CreateRequestedJoints ( ) : void
DeleteRequestedJoints ( ) : void
InternalAddActiveJoint ( OpenSim.Region.Physics.Manager.PhysicsJoint joint ) : void
InternalAddPendingJoint ( OpenSim.Region.Physics.OdePlugin.OdePhysicsJoint joint ) : void
InternalRemoveActiveJoint ( OpenSim.Region.Physics.Manager.PhysicsJoint joint ) : void
InternalRemovePendingJoint ( OpenSim.Region.Physics.Manager.PhysicsJoint joint ) : void
RemoveAllJointsConnectedToActor ( PhysicsActor actor ) : void
checkDupe ( Ode.NET.d contactGeom, int atype ) : bool
collision_accounting_events ( PhysicsActor p1, PhysicsActor p2, ContactPoint contact ) : void
collision_optimized ( float timeStep ) : void

This is our collision testing routine in ODE

near ( IntPtr space, IntPtr g1, IntPtr g2 ) : void

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

waitForSpaceUnlock ( IntPtr space ) : void

Method Details

AddAvatar() public méthode

public AddAvatar ( string avName, System.Vector3 position, System.Vector3 size, bool isFlying ) : PhysicsActor
avName string
position System.Vector3
size System.Vector3
isFlying bool
Résultat PhysicsActor

AddCharacter() public méthode

public AddCharacter ( OpenSim.Region.Physics.OdePlugin.OdeCharacter chr ) : void
chr OpenSim.Region.Physics.OdePlugin.OdeCharacter
Résultat void

AddPhysicsActorTaint() public méthode

Called after our prim properties are set Scale, position etc. We use this event queue like method to keep changes to the physical scene occuring in the threadlocked mutex This assures us that we have no race conditions
public AddPhysicsActorTaint ( PhysicsActor prim ) : void
prim PhysicsActor
Résultat void

AddPrimShape() public méthode

public AddPrimShape ( string primName, OpenSim.Framework.PrimitiveBaseShape pbs, System.Vector3 position, System.Vector3 size, Quaternion rotation ) : PhysicsActor
primName string
pbs OpenSim.Framework.PrimitiveBaseShape
position System.Vector3
size System.Vector3
rotation Quaternion
Résultat PhysicsActor

AddPrimShape() public méthode

public AddPrimShape ( string primName, OpenSim.Framework.PrimitiveBaseShape pbs, System.Vector3 position, System.Vector3 size, Quaternion rotation, bool isPhysical ) : PhysicsActor
primName string
pbs OpenSim.Framework.PrimitiveBaseShape
position System.Vector3
size System.Vector3
rotation Quaternion
isPhysical bool
Résultat PhysicsActor

BadCharacter() public méthode

public BadCharacter ( OpenSim.Region.Physics.OdePlugin.OdeCharacter chr ) : void
chr OpenSim.Region.Physics.OdePlugin.OdeCharacter
Résultat void

Combine() public méthode

public Combine ( PhysicsScene pScene, System.Vector3 offset, System.Vector3 extents ) : void
pScene PhysicsScene
offset System.Vector3
extents System.Vector3
Résultat void

DeleteTerrain() public méthode

public DeleteTerrain ( ) : void
Résultat void

Dispose() public méthode

public Dispose ( ) : void
Résultat void

DumpJointInfo() public méthode

public DumpJointInfo ( ) : void
Résultat void

GetJointAnchor() public méthode

public GetJointAnchor ( OpenSim.Region.Physics.Manager.PhysicsJoint joint ) : System.Vector3
joint OpenSim.Region.Physics.Manager.PhysicsJoint
Résultat System.Vector3

GetJointAxis() public méthode

public GetJointAxis ( OpenSim.Region.Physics.Manager.PhysicsJoint joint ) : System.Vector3
joint OpenSim.Region.Physics.Manager.PhysicsJoint
Résultat System.Vector3

GetResults() public méthode

public GetResults ( ) : void
Résultat void

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
Résultat float

Initialise() public méthode

public Initialise ( IMesher meshmerizer, IVoxelMesher voxmesh, IConfigSource config ) : void
meshmerizer IMesher
voxmesh IVoxelMesher
config IConfigSource
Résultat void

OdeScene() public méthode

Initiailizes the scene Sets many properties that ODE requires to be stable These settings need to be tweaked 'exactly' right or weird stuff happens.
public OdeScene ( OpenSim.Region.Physics.Manager.CollisionLocker dode, string sceneIdentifier ) : System
dode OpenSim.Region.Physics.Manager.CollisionLocker
sceneIdentifier string
Résultat System

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

RemoveAllJointsConnectedToActorThreadLocked() public méthode

public RemoveAllJointsConnectedToActorThreadLocked ( PhysicsActor actor ) : void
actor PhysicsActor
Résultat void

RemoveAvatar() public méthode

public RemoveAvatar ( PhysicsActor actor ) : void
actor PhysicsActor
Résultat void

RemoveCharacter() public méthode

public RemoveCharacter ( OpenSim.Region.Physics.OdePlugin.OdeCharacter chr ) : void
chr OpenSim.Region.Physics.OdePlugin.OdeCharacter
Résultat void

RemovePrim() public méthode

public RemovePrim ( PhysicsActor prim ) : void
prim PhysicsActor
Résultat void

RemovePrimThreadLocked() public méthode

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.
public RemovePrimThreadLocked ( OpenSim.Region.Physics.OdePlugin.OdePrim prim ) : void
prim OpenSim.Region.Physics.OdePlugin.OdePrim
Résultat void

RequestJointCreation() public méthode

public RequestJointCreation ( string objectNameInScene, PhysicsJointType jointType, System.Vector3 position, Quaternion rotation, string parms, List bodyNames, string trackedBodyName, Quaternion localRotation ) : OpenSim.Region.Physics.Manager.PhysicsJoint
objectNameInScene string
jointType PhysicsJointType
position System.Vector3
rotation Quaternion
parms string
bodyNames List
trackedBodyName string
localRotation Quaternion
Résultat OpenSim.Region.Physics.Manager.PhysicsJoint

RequestJointDeletion() public méthode

public RequestJointDeletion ( string ObjectNameInScene ) : void
ObjectNameInScene string
Résultat void

ResizeTerrain512Interpolation() public méthode

public ResizeTerrain512Interpolation ( float heightMap ) : float[]
heightMap float
Résultat float[]

ResizeTerrain512NearestNeighbour() public méthode

public ResizeTerrain512NearestNeighbour ( float heightMap ) : float[]
heightMap float
Résultat float[]

SetTerrain() public méthode

public SetTerrain ( bool voxmap ) : void
voxmap bool
Résultat void

SetTerrain() public méthode

public SetTerrain ( bool voxmap, System.Vector3 pOffset ) : void
voxmap bool
pOffset System.Vector3
Résultat void

SetWaterLevel() public méthode

public SetWaterLevel ( float baseheight ) : void
baseheight float
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 timeStep ) : float
timeStep float
Résultat float

SupportsCombining() public méthode

public SupportsCombining ( ) : bool
Résultat bool

SupportsRayCast() public méthode

public SupportsRayCast ( ) : bool
Résultat bool

TriArrayCallback() public méthode

public TriArrayCallback ( IntPtr trimesh, IntPtr refObject, int triangleIndex, int triCount ) : int
trimesh System.IntPtr
refObject System.IntPtr
triangleIndex int
triCount int
Résultat int

TriCallback() public méthode

public TriCallback ( IntPtr trimesh, IntPtr refObject, int triangleIndex ) : int
trimesh System.IntPtr
refObject System.IntPtr
triangleIndex int
Résultat int

UnCombine() public méthode

public UnCombine ( PhysicsScene pScene ) : void
pScene PhysicsScene
Résultat void

addActivePrim() public méthode

public addActivePrim ( OpenSim.Region.Physics.OdePlugin.OdePrim activatePrim ) : void
activatePrim OpenSim.Region.Physics.OdePlugin.OdePrim
Résultat void

addCollisionEventReporting() public méthode

public addCollisionEventReporting ( PhysicsActor obj ) : void
obj PhysicsActor
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

command() public méthode

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

createprimspace() public méthode

Creates a new space at X Y
public createprimspace ( int iprimspaceArrItemX, int iprimspaceArrItemY ) : IntPtr
iprimspaceArrItemX int
iprimspaceArrItemY int
Résultat System.IntPtr

needsMeshing() public méthode

Routine to figure out if we need to mesh this prim with our mesher
public needsMeshing ( OpenSim.Framework.PrimitiveBaseShape pbs ) : bool
pbs OpenSim.Framework.PrimitiveBaseShape
Résultat bool

randomizeWater() public méthode

public randomizeWater ( float baseheight ) : void
baseheight float
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, Vector3 pos, IntPtr currentspace ) : IntPtr
geom IntPtr the pointer to the geom that moved
pos Vector3 the position that the geom moved to
currentspace IntPtr a pointer to the space it was in before it was moved.
Résultat IntPtr

remActivePrim() public méthode

public remActivePrim ( OdePrim deactivatePrim ) : void
deactivatePrim OdePrim
Résultat void

remCollisionEventReporting() public méthode

public remCollisionEventReporting ( PhysicsActor obj ) : void
obj PhysicsActor
Résultat void

resetSpaceArrayItemToZero() public méthode

Takes a space pointer and zeros out the array we're using to hold the spaces
public resetSpaceArrayItemToZero ( IntPtr pSpace ) : void
pSpace IntPtr
Résultat void

resetSpaceArrayItemToZero() public méthode

public resetSpaceArrayItemToZero ( int arrayitemX, int arrayitemY ) : void
arrayitemX int
arrayitemY int
Résultat void

start() public méthode

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

startvisualization() public méthode

public startvisualization ( object o ) : void
o object
Résultat void

step() public méthode

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

whichspaceamIin() public méthode

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

Property Details

MeshSculptphysicalLOD public_oe property

public float MeshSculptphysicalLOD
Résultat float

OdeLock public_oe property

public Object OdeLock
Résultat Object

WorldExtents public_oe property

public Vector2,System WorldExtents
Résultat System.Vector2

actor_name_map public_oe property

public Dictionary actor_name_map
Résultat PhysicsActor>.Dictionary

bodyFramesAutoDisable public_oe property

public int bodyFramesAutoDisable
Résultat int

bodyMotorJointMaxforceTensor public_oe property

public float bodyMotorJointMaxforceTensor
Résultat float

bodyPIDD public_oe property

public float bodyPIDD
Résultat float

bodyPIDG public_oe property

public float bodyPIDG
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

geomDefaultDensity public_oe property

public float geomDefaultDensity
Résultat float

geomUpdatesPerThrottledUpdate public_oe property

public int geomUpdatesPerThrottledUpdate
Résultat int

geom_name_map public_oe property

public Dictionary geom_name_map
Résultat String>.Dictionary

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

hpr public_oe property

public d.Vector3,Ode.NET hpr
Résultat Ode.NET.d.Vector3

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

physics_logging public_oe property

public bool physics_logging
Résultat bool

physics_logging_append_existing_logfile public_oe property

public bool physics_logging_append_existing_logfile
Résultat bool

physics_logging_interval public_oe property

public int physics_logging_interval
Résultat int

space public_oe property

public IntPtr space
Résultat IntPtr

staticPrimspace public_oe property

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

triArrayCallback public_oe property

public d.TriArrayCallback triArrayCallback
Résultat d.TriArrayCallback

triCallback public_oe property

public d.TriCallback triCallback
Résultat d.TriCallback

voxmesher public_oe property

public IVoxelMesher voxmesher
Résultat IVoxelMesher

world public_oe property

public IntPtr world
Résultat IntPtr

xyz public_oe property

public d.Vector3 xyz
Résultat d.Vector3