本文整理汇总了C#中Aurora.Physics.AuroraOpenDynamicsEngine.AuroraODEPhysicsScene.AddSimulationChange方法的典型用法代码示例。如果您正苦于以下问题:C# AuroraODEPhysicsScene.AddSimulationChange方法的具体用法?C# AuroraODEPhysicsScene.AddSimulationChange怎么用?C# AuroraODEPhysicsScene.AddSimulationChange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aurora.Physics.AuroraOpenDynamicsEngine.AuroraODEPhysicsScene
的用法示例。
在下文中一共展示了AuroraODEPhysicsScene.AddSimulationChange方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AuroraODECharacter
public AuroraODECharacter(String avName, AuroraODEPhysicsScene parent_scene, Vector3 pos, Quaternion rotation,
Vector3 size)
{
m_uuid = UUID.Random();
_parent_scene = parent_scene;
m_taintRotation = rotation;
if (pos.IsFinite())
{
if (pos.Z > 9999999f || pos.Z < -90f)
{
pos.Z =
_parent_scene.GetTerrainHeightAtXY(_parent_scene.Region.RegionSizeX * 0.5f,
_parent_scene.Region.RegionSizeY * 0.5f) + 5.0f;
}
_position = pos;
}
else
{
_position.X = _parent_scene.Region.RegionSizeX * 0.5f;
_position.Y = _parent_scene.Region.RegionSizeY * 0.5f;
_position.Z = _parent_scene.GetTerrainHeightAtXY(_position.X, _position.Y) + 10f;
MainConsole.Instance.Warn("[PHYSICS]: Got NaN Position on Character Create");
}
CAPSULE_RADIUS = _parent_scene.avCapRadius;
CAPSULE_LENGTH = (size.Z*1.1f) - CAPSULE_RADIUS*2.0f;
AvatarHalfsize = CAPSULE_LENGTH*0.5f + CAPSULE_RADIUS;
m_isPhysical = false; // current status: no ODE information exists
_parent_scene.AddSimulationChange(() => RebuildAvatar());
m_name = avName;
}
示例2: AuroraODEPrim
public AuroraODEPrim(string name, byte physicsType, PrimitiveBaseShape shape, Vector3 position, Vector3 size, Quaternion rotation,
int material, float friction, float restitution, float gravityMultiplier, float density, AuroraODEPhysicsScene parent_scene)
{
m_vehicle = new AuroraODEDynamics();
// correct for changed timestep
PID_D /= (parent_scene.ODE_STEPSIZE*50f); // original ode fps of 50
PID_G /= (parent_scene.ODE_STEPSIZE*50f);
body_autodisable_frames = parent_scene.bodyFramesAutoDisable;
prim_geom = IntPtr.Zero;
_name = name;
PhysicsShapeType = physicsType;
_size = size;
_position = position;
fakepos = 0;
_orientation = rotation;
fakeori = 0;
_pbs = shape;
_parent_scene = parent_scene;
m_targetSpace = IntPtr.Zero;
/*
m_isphysical = pisPhysical;
if (m_isphysical)
m_targetSpace = _parent_scene.space;
*/
m_isphysical = false;
m_forceacc = Vector3.Zero;
m_angularforceacc = Vector3.Zero;
hasOOBoffsetFromMesh = false;
_triMeshData = IntPtr.Zero;
SetMaterial(material, friction, restitution, gravityMultiplier, density);
CalcPrimBodyData();
_parent_scene.AddSimulationChange(() => changeadd());
}
示例3: AuroraODEPrim
private Vector3 showposition; // a temp hack for now rest of code expects position to be changed immediately
public AuroraODEPrim(ISceneChildEntity entity, AuroraODEPhysicsScene parent_scene, bool pisPhysical)
{
m_vehicle = new AuroraODEDynamics();
//gc = GCHandle.Alloc(prim_geom, GCHandleType.Pinned);
// correct for changed timestep
PID_D /= (parent_scene.ODE_STEPSIZE * 50f); // original ode fps of 50
PID_G /= (parent_scene.ODE_STEPSIZE * 50f);
body_autodisable_frames = parent_scene.bodyFramesAutoDisable;
prim_geom = IntPtr.Zero;
_size = entity.Scale;
_position = entity.AbsolutePosition;
fakepos = 0;
_orientation = entity.GetWorldRotation();
fakeori = 0;
_pbs = entity.Shape;
_parent_entity = entity;
_parent_scene = parent_scene;
m_targetSpace = IntPtr.Zero;
/*
m_isphysical = pisPhysical;
if (m_isphysical)
m_targetSpace = _parent_scene.space;
*/
m_isphysical = false;
m_forceacc = Vector3.Zero;
m_angularforceacc = Vector3.Zero;
hasOOBoffsetFromMesh = false;
_triMeshData = IntPtr.Zero;
CalcPrimBodyData();
_parent_scene.AddSimulationChange(() => changeadd());
}