本文整理汇总了C#中OpenSim.Region.Physics.BulletSPlugin.BSScene.TaintedObject方法的典型用法代码示例。如果您正苦于以下问题:C# BSScene.TaintedObject方法的具体用法?C# BSScene.TaintedObject怎么用?C# BSScene.TaintedObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Region.Physics.BulletSPlugin.BSScene
的用法示例。
在下文中一共展示了BSScene.TaintedObject方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BSCharacter
public BSCharacter(uint localID, String avName, BSScene parent_scene, Vector3 pos, Vector3 size, bool isFlying)
{
_localID = localID;
_avName = avName;
_scene = parent_scene;
_position = pos;
_size = size;
_flying = isFlying;
_orientation = Quaternion.Identity;
_velocity = Vector3.Zero;
_buoyancy = isFlying ? 1f : 0f;
_scale = new Vector3(1f, 1f, 1f);
_density = _scene.Params.avatarDensity;
ComputeAvatarVolumeAndMass(); // set _avatarVolume and _mass based on capsule size, _density and _scale
ShapeData shapeData = new ShapeData();
shapeData.ID = _localID;
shapeData.Type = ShapeData.PhysicsShapeType.SHAPE_AVATAR;
shapeData.Position = _position;
shapeData.Rotation = _orientation;
shapeData.Velocity = _velocity;
shapeData.Scale = _scale;
shapeData.Mass = _mass;
shapeData.Buoyancy = _buoyancy;
shapeData.Static = ShapeData.numericFalse;
shapeData.Friction = _scene.Params.avatarFriction;
shapeData.Restitution = _scene.Params.defaultRestitution;
// do actual create at taint time
_scene.TaintedObject(delegate()
{
BulletSimAPI.CreateObject(parent_scene.WorldID, shapeData);
});
return;
}
示例2: BSPrim
public BSPrim(ISceneChildEntity entity, bool isPhysical, BSScene parent_scene)
{
_parent_entity = entity;
// m_log.DebugFormat("{0}: BSPrim creation of {1}, id={2}", LogHeader, primName, localID);
_localID = _parent_entity.LocalId;
_avName = _parent_entity.Name;
_scene = parent_scene;
_position = _parent_entity.AbsolutePosition;
_size = _parent_entity.Scale;
_scale = new OMV.Vector3(1f, 1f, 1f); // the scale will be set by CreateGeom depending on object type
_orientation = _parent_entity.Rotation;
_buoyancy = 1f;
_velocity = OMV.Vector3.Zero;
_rotationalVelocity = OMV.Vector3.Zero;
_angularVelocity = OMV.Vector3.Zero;
_hullKey = 0;
_pbs = _parent_entity.Shape;
_isPhysical = isPhysical;
_isVolumeDetect = _parent_entity.VolumeDetectActive;
_subscribedEventsMs = 0;
_parentPrim = null;
_vehicle = new BSDynamics(this);
_childrenPrims = new List<BSPrim>();
if (_isPhysical)
_mass = CalculateMass();
else
_mass = 0f;
// do the actual object creation at taint time
_scene.TaintedObject(delegate()
{
RecreateGeomAndObject();
});
}
示例3: BSPrim
public BSPrim(uint localID, String primName, BSScene parent_scene, OMV.Vector3 pos, OMV.Vector3 size,
OMV.Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical)
{
// m_log.DebugFormat("{0}: BSPrim creation of {1}, id={2}", LogHeader, primName, localID);
_localID = localID;
_avName = primName;
_scene = parent_scene;
_position = pos;
_size = size;
_scale = new OMV.Vector3(1f, 1f, 1f); // the scale will be set by CreateGeom depending on object type
_orientation = rotation;
_buoyancy = 1f;
_velocity = OMV.Vector3.Zero;
_rotationalVelocity = OMV.Vector3.Zero;
_angularVelocity = OMV.Vector3.Zero;
_hullKey = 0;
_meshKey = 0;
_pbs = pbs;
_isPhysical = pisPhysical;
_isVolumeDetect = false;
_subscribedEventsMs = 0;
_friction = _scene.Params.defaultFriction; // TODO: compute based on object material
_density = _scene.Params.defaultDensity; // TODO: compute based on object material
_restitution = _scene.Params.defaultRestitution;
_parentPrim = null; // not a child or a parent
_vehicle = new BSDynamics(this); // add vehicleness
_childrenPrims = new List<BSPrim>();
if (_isPhysical)
_mass = CalculateMass();
else
_mass = 0f;
// do the actual object creation at taint time
_scene.TaintedObject(delegate()
{
RecreateGeomAndObject();
});
}
示例4: BSCharacter
public BSCharacter(uint localID, UUID avID, String avName, BSScene parent_scene, Vector3 pos,
Quaternion rotation, Vector3 size, bool isFlying)
{
_localID = localID;
_avID = avID;
_avName = avName;
_scene = parent_scene;
_position = pos;
_orientation = rotation;
_size = size;
_orientation = Quaternion.Identity;
_velocity = Vector3.Zero;
_scale = new Vector3(1f, 1f, 1f);
float AVvolume =
(float) (Math.PI*Math.Pow(_scene.Params.avatarCapsuleRadius, 2)*_scene.Params.avatarCapsuleHeight);
_density = _scene.Params.avatarDensity;
_mass = _density*AVvolume;
_isPhysical = true;
ShapeData shapeData = new ShapeData
{
ID = _localID,
Type = ShapeData.PhysicsShapeType.SHAPE_AVATAR,
Position = _position,
Rotation = _orientation,
Velocity = _velocity,
Scale = _scale,
Mass = _mass,
Buoyancy = isFlying ? 1f : 0f,
Static = ShapeData.numericFalse,
Friction = _scene.Params.avatarFriction,
Restitution = _scene.Params.defaultRestitution
};
// do actual create at taint time
_scene.TaintedObject(() => BulletSimAPI.CreateObject(parent_scene.WorldID, shapeData));
return;
}