本文整理汇总了C#中ISceneChildEntity.GetWorldRotation方法的典型用法代码示例。如果您正苦于以下问题:C# ISceneChildEntity.GetWorldRotation方法的具体用法?C# ISceneChildEntity.GetWorldRotation怎么用?C# ISceneChildEntity.GetWorldRotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISceneChildEntity
的用法示例。
在下文中一共展示了ISceneChildEntity.GetWorldRotation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AuroraPhysXPrim
public AuroraPhysXPrim(ISceneChildEntity entity, AuroraODEPhysicsScene parent_scene, bool pisPhysical, CollisionLocker dode)
{
m_vehicle = new AuroraPhysXDynamics ();
//gc = GCHandle.Alloc(prim_geom, GCHandleType.Pinned);
ode = dode;
PID_D = parent_scene.bodyPIDD;
PID_G = parent_scene.bodyPIDG;
// correct for changed timestep
PID_D /= (parent_scene.ODE_STEPSIZE * 50f); // original ode fps of 50
PID_G /= (parent_scene.ODE_STEPSIZE * 50f);
// m_tensor = parent_scene.bodyMotorJointMaxforceTensor;
body_autodisable_frames = parent_scene.bodyFramesAutoDisable;
prim_geom = IntPtr.Zero;
prev_geom = IntPtr.Zero;
_size = entity.Scale;
_position = entity.AbsolutePosition;
fakepos = false;
_orientation = entity.GetWorldRotation ();
fakeori = false;
_pbs = entity.Shape;
_parent_entity = entity;
_parent_scene = parent_scene;
m_targetSpace = (IntPtr)0;
m_isphysical = pisPhysical;
// If we're physical, we need to be in the master space for now.
// linksets *should* be in a space together.. but are not currently
if (m_isphysical)
m_targetSpace = _parent_scene.space;
m_forceacc = Vector3.Zero;
m_angularforceacc = Vector3.Zero;
m_UpdateTimecntr = 0;
m_UpdateFPScntr = 2.5f * parent_scene.StepTime; // this parameter needs retunning and possible came from ini file
if (m_UpdateTimecntr > .1f) // try to keep it under 100ms
m_UpdateTimecntr = .1f;
AddChange (changes.Add, null);
}
示例2: AuroraODEPrim
public AuroraODEPrim (ISceneChildEntity entity, AuroraODEPhysicsScene parent_scene, bool pisPhysical)
{
m_vehicle = new AuroraODEDynamics ();
//gc = GCHandle.Alloc(prim_geom, GCHandleType.Pinned);
PID_D = parent_scene.bodyPIDD;
PID_G = parent_scene.bodyPIDG;
// 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();
m_UpdateTimecntr = 0;
m_UpdateFPScntr = 2.5f * parent_scene.StepTime; // this parameter needs retunning and possible came from ini file
if (m_UpdateTimecntr > .1f) // try to keep it under 100ms
m_UpdateTimecntr = .1f;
AddChange (changes.Add, null);
}
示例3: GetPartRot
private LSL_Rotation GetPartRot (ISceneChildEntity part)
{
Quaternion q;
if (part.LinkNum == 0 || part.LinkNum == 1) // unlinked or root prim
{
if (part.ParentEntity.RootChild.AttachmentPoint != 0)
{
IScenePresence avatar = World.GetScenePresence(part.AttachedAvatar);
if (avatar != null)
{
if ((avatar.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0)
q = avatar.CameraRotation; // Mouselook
else
q = avatar.Rotation; // Currently infrequently updated so may be inaccurate
}
else
q = part.ParentEntity.GroupRotation; // Likely never get here but just in case
}
else
q = part.ParentEntity.GroupRotation; // just the group rotation
return new LSL_Rotation(q.X, q.Y, q.Z, q.W);
}
q = part.GetWorldRotation();
return new LSL_Rotation(q.X, q.Y, q.Z, q.W);
}
示例4: 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());
}