本文整理汇总了C#中OpenSim.Region.Physics.BulletSPlugin.BSScene类的典型用法代码示例。如果您正苦于以下问题:C# BSScene类的具体用法?C# BSScene怎么用?C# BSScene使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BSScene类属于OpenSim.Region.Physics.BulletSPlugin命名空间,在下文中一共展示了BSScene类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BSPrim
public BSPrim(uint localID, String primName, BSScene parent_scene, OMV.Vector3 pos, OMV.Vector3 size,
OMV.Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical)
: base(parent_scene, localID, primName, "BSPrim")
{
// m_log.DebugFormat("{0}: BSPrim creation of {1}, id={2}", LogHeader, primName, localID);
_physicsActorType = (int)ActorTypes.Prim;
_position = pos;
_size = size;
Scale = size; // prims are the size the user wants them to be (different for BSCharactes).
_orientation = rotation;
_buoyancy = 0f;
RawVelocity = OMV.Vector3.Zero;
_rotationalVelocity = OMV.Vector3.Zero;
BaseShape = pbs;
_isPhysical = pisPhysical;
_isVolumeDetect = false;
// We keep a handle to the vehicle actor so we can set vehicle parameters later.
VehicleActor = new BSDynamics(PhysScene, this, VehicleActorName);
PhysicalActors.Add(VehicleActorName, VehicleActor);
_mass = CalculateMass();
// DetailLog("{0},BSPrim.constructor,call", LocalID);
// do the actual object creation at taint time
PhysScene.TaintedObject("BSPrim.create", delegate()
{
// Make sure the object is being created with some sanity.
ExtremeSanityCheck(true /* inTaintTime */);
CreateGeomAndObject(true);
CurrentCollisionFlags = PhysScene.PE.GetCollisionFlags(PhysBody);
});
}
示例2: BSActorAvatarMove
public BSActorAvatarMove(BSScene physicsScene, BSPhysObject pObj, string actorName)
: base(physicsScene, pObj, actorName)
{
m_velocityMotor = null;
m_walkingUpStairs = 0;
m_physicsScene.DetailLog("{0},BSActorAvatarMove,constructor", m_controllingPrim.LocalID);
}
示例3: BSPhysObject
protected BSPhysObject(BSScene parentScene, uint localID, string name, string typeName)
{
PhysicsScene = parentScene;
LocalID = localID;
PhysObjectName = name;
Name = name; // PhysicsActor also has the name of the object. Someday consolidate.
TypeName = typeName;
// Initialize variables kept in base.
GravModifier = 1.0f;
Gravity = new OMV.Vector3(0f, 0f, BSParam.Gravity);
// We don't have any physical representation yet.
PhysBody = new BulletBody(localID);
PhysShape = new BulletShape();
LastAssetBuildFailed = false;
// Default material type. Also sets Friction, Restitution and Density.
SetMaterial((int)MaterialAttributes.Material.Wood);
CollisionCollection = new CollisionEventUpdate();
CollisionsLastTick = CollisionCollection;
SubscribedEventsMs = 0;
CollidingStep = 0;
CollidingGroundStep = 0;
CollisionAccumulation = 0;
ColliderIsMoving = false;
CollisionScore = 0;
// All axis free.
LockedAxis = LockedAxisFree;
}
示例4: Factory
// Create the correct type of linkset for this child
public static BSLinkset Factory(BSScene physScene, BSPrimLinkable parent)
{
BSLinkset ret = null;
switch (parent.LinksetType)
{
case LinksetImplementation.Constraint:
ret = new BSLinksetConstraints(physScene, parent);
break;
case LinksetImplementation.Compound:
ret = new BSLinksetCompound(physScene, parent);
break;
case LinksetImplementation.Manual:
// ret = new BSLinksetManual(physScene, parent);
break;
default:
ret = new BSLinksetCompound(physScene, parent);
break;
}
if (ret == null)
{
physScene.Logger.ErrorFormat("[BULLETSIM LINKSET] Factory could not create linkset. Parent name={1}, ID={2}", parent.Name, parent.LocalID);
}
return ret;
}
示例5: GetShapeReference
// Get a reference to a physical shape. Create if it doesn't exist
public static BSShape GetShapeReference(BSScene physicsScene, bool forceRebuild, BSPhysObject prim)
{
BSShape ret = null;
if (prim.PreferredPhysicalShape == BSPhysicsShapeType.SHAPE_CAPSULE)
{
// an avatar capsule is close to a native shape (it is not shared)
ret = BSShapeNative.GetReference(physicsScene, prim, BSPhysicsShapeType.SHAPE_CAPSULE,
FixedShapeKey.KEY_CAPSULE);
physicsScene.DetailLog("{0},BSShape.GetShapeReference,avatarCapsule,shape={1}", prim.LocalID, ret);
}
// Compound shapes are handled special as they are rebuilt from scratch.
// This isn't too great a hardship since most of the child shapes will have already been created.
if (ret == null && prim.PreferredPhysicalShape == BSPhysicsShapeType.SHAPE_COMPOUND)
{
// Getting a reference to a compound shape gets you the compound shape with the root prim shape added
ret = BSShapeCompound.GetReference(prim);
physicsScene.DetailLog("{0},BSShapeCollection.CreateGeom,compoundShape,shape={1}", prim.LocalID, ret);
}
// Avatars have their own unique shape
if (ret == null && prim.PreferredPhysicalShape == BSPhysicsShapeType.SHAPE_AVATAR)
{
// Getting a reference to a compound shape gets you the compound shape with the root prim shape added
ret = BSShapeAvatar.GetReference(prim);
physicsScene.DetailLog("{0},BSShapeCollection.CreateGeom,avatarShape,shape={1}", prim.LocalID, ret);
}
if (ret == null)
ret = GetShapeReferenceNonSpecial(physicsScene, forceRebuild, prim);
return ret;
}
示例6: BSActorLockAxis
public BSActorLockAxis(BSScene physicsScene, BSPhysObject pObj, string actorName)
: base(physicsScene, pObj, actorName)
{
m_physicsScene.DetailLog("{0},BSActorLockAxis,constructor", m_controllingPrim.LocalID);
LockAxisConstraint = null;
HaveRegisteredForBeforeStepCallback = false;
}
示例7: BSActor
public BSActor(BSScene physicsScene, BSPhysObject pObj, string actorName)
{
m_physicsScene = physicsScene;
m_controllingPrim = pObj;
ActorName = actorName;
Enabled = true;
}
示例8: GetScene
public PhysicsScene GetScene(String sceneIdentifier)
{
if (_mScene == null)
{
_mScene = new BSScene(GetName(), sceneIdentifier);
}
return (_mScene);
}
示例9: BSShapeCollection
public BSShapeCollection(BSScene physScene)
{
PhysicsScene = physScene;
// Set the next to 'true' for very detailed shape update detailed logging (detailed details?)
// While detailed debugging is still active, this is better than commenting out all the
// DetailLog statements. When debugging slows down, this and the protected logging
// statements can be commented/removed.
DDetail = true;
}
示例10: ApplyCollisionMask
// Apply the specificed collision mask into the physical world
public virtual bool ApplyCollisionMask(BSScene physicsScene)
{
// Should assert the body has been added to the physical world.
// (The collision masks are stored in the collision proxy cache which only exists for
// a collision body that is in the world.)
return physicsScene.PE.SetCollisionGroupMask(this,
BulletSimData.CollisionTypeMasks[collisionType].group,
BulletSimData.CollisionTypeMasks[collisionType].mask);
}
示例11: BSActorLockAxis
public BSActorLockAxis(BSScene physicsScene, BSPhysObject pObj, string actorName)
: base(physicsScene, pObj, actorName)
{
m_physicsScene.DetailLog("{0},BSActorLockAxis,constructor", m_controllingPrim.LocalID);
LockAxisConstraint = null;
// we place our constraint just before the simulation step to make sure the linkset is complete
m_physicsScene.BeforeStep += PhysicsScene_BeforeStep;
}
示例12: GetScene
public PhysicsScene GetScene(String sceneIdentifier)
{
if (_mScene == null)
{
if (Util.IsWindows())
Util.LoadArchSpecificWindowsDll("BulletSim.dll");
_mScene = new BSScene(sceneIdentifier);
}
return (_mScene);
}
示例13: BSPrimLinkable
public BSPrimLinkable(uint localID, String primName, BSScene parent_scene, OMV.Vector3 pos, OMV.Vector3 size,
OMV.Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical)
: base(localID, primName, parent_scene, pos, size, rotation, pbs, pisPhysical)
{
// Default linkset implementation for this prim
LinksetType = (BSLinkset.LinksetImplementation)BSParam.LinksetImplementation;
Linkset = BSLinkset.Factory(PhysScene, this);
Linkset.Refresh(this);
}
示例14: BSPrimLinkable
public BSPrimLinkable(uint localID, String primName, BSScene parent_scene, OMV.Vector3 pos, OMV.Vector3 size,
OMV.Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical)
: base(localID, primName, parent_scene, pos, size, rotation, pbs, pisPhysical)
{
Linkset = BSLinkset.Factory(PhysScene, this);
PhysScene.TaintedObject("BSPrimLinksetCompound.Refresh", delegate()
{
Linkset.Refresh(this);
});
}
示例15: BSAPIUnman
public BSAPIUnman(string paramName, BSScene physScene)
{
PhysicsScene = physScene;
// Do something fancy with the paramName to get the right DLL implementation
// like "Bullet-2.80-OpenCL-Intel" loading the version for Intel based OpenCL implementation, etc.
if (Util.IsWindows())
Util.LoadArchSpecificWindowsDll("BulletSim.dll");
// If not Windows, loading is performed by the
// Mono loader as specified in
// "bin/Physics/OpenSim.Region.Physics.BulletSPlugin.dll.config".
}