コード例 #1
0
        public PhysicsShadowWorld(
            IEventEngine <IPhysicsEventContext> physicsEventEngine,
            IHierarchy hierarchy,
            IDebugRenderer debugRenderer,
            IConsoleHandle consoleHandle)
        {
            _physicsEventEngine = physicsEventEngine;
            _hierarchy          = hierarchy;
            _debugRenderer      = debugRenderer;
            _consoleHandle      = consoleHandle;

            var collisionSystem = new CollisionSystemPersistentSAP
            {
                EnableSpeculativeContacts = true
            };

            _physicsWorld = new JitterWorld(collisionSystem);
            _physicsWorld.ContactSettings.MaterialCoefficientMixing =
                ContactSettings.MaterialCoefficientMixingType.TakeMinimum;

            _physicsWorld.Gravity = new JVector(0, -10f, 0);

            _rigidBodyMappings = new List <RigidBodyMapping>();

            _lastFramePosition = new Dictionary <int, Vector3>();
            _lastFrameRotation = new Dictionary <int, Quaternion>();
            _transformCache    = new Dictionary <int, WeakReference <IHasTransform> >();

            _physicsWorld.Events.BodiesBeginCollide += EventsOnBodiesBeginCollide;
            _physicsWorld.Events.BodiesEndCollide   += EventsOnBodiesEndCollide;
        }
コード例 #2
0
 public RenderingSystemIntegrationTestsSut(IAssetStore assetStore, IDebugRenderer debugRenderer, IRenderingBackend renderingBackend,
                                           IRenderingSystem renderingSystem)
 {
     AssetStore       = assetStore;
     DebugRenderer    = debugRenderer;
     RenderingBackend = renderingBackend;
     RenderingSystem  = renderingSystem;
 }
コード例 #3
0
 public InspectorGameHostExtension(
     [Optional] IPhysicsEngine physicsEngine,
     IDebugRenderer debugRenderer,
     InspectorRenderPass inspectorRenderPass,
     IConsoleHandle consoleHandle)
 {
     _physicsEngine       = physicsEngine;
     _debugRenderer       = debugRenderer;
     _inspectorRenderPass = inspectorRenderPass;
     _consoleHandle       = consoleHandle;
     _rigidBodyRef        = new WeakReference <RigidBody>(null);
 }
コード例 #4
0
        public PerPixelCollisionShadowWorld(
            IHierarchy hierarchy,
            IEventEngine <IPerPixelCollisionEventContext> perPixelCollisionEventEngine,
            IDebugRenderer debugRenderer)
        {
            _hierarchy = hierarchy;
            _perPixelCollisionEventEngine = perPixelCollisionEventEngine;
            _debugRenderer = debugRenderer;
            _components    = new HashSet <WeakReference <IPerPixelCollisionComponent> >();

            _waitForChanges = false;
            _pendingChanges = new List <Action>();
        }
コード例 #5
0
        public FirstPersonCameraComponent(
            INode node,
            IDebugRenderer debugRenderer,
            IFirstPersonCamera firstPersonCamera)
        {
            _node              = node;
            _debugRenderer     = debugRenderer;
            _firstPersonCamera = firstPersonCamera;
            HeadOffset         = new Vector3(0, 0, 0);
            Enabled            = true;
            DebugEnabled       = false;
            FieldOfView        = (MathHelper.PiOver2 / 90) * 75;

            Enabled = true;
        }
コード例 #6
0
        public FirstPersonCameraComponent(
            INode node,
            IDebugRenderer debugRenderer,
            IFirstPersonCamera firstPersonCamera)
        {
            _node = node;
            _debugRenderer = debugRenderer;
            _firstPersonCamera = firstPersonCamera;
            HeadOffset = new Vector3(0, 0, 0);
            Enabled = true;
            DebugEnabled = false;
            FieldOfView = (MathHelper.PiOver2/90)*75;

            Enabled = true;
        }
コード例 #7
0
        public FirstPersonControllerPhysicsComponent(
            IPhysicsEngine physicsEngine,
            IDebugRenderer debugRenderer,
            [FromParent, RequireExisting] IPhysicalComponent physicalComponent)
        {
            _physicsEngine = physicsEngine;
            _debugRenderer = debugRenderer;
            _physicalComponent = physicalComponent;

            TargetVelocity = Vector3.Zero;
            TryJump = false;
            JumpVelocity = 0.5f;
            Stiffness = 0.02f;

            Enabled = true;
        }
コード例 #8
0
        public FirstPersonControllerPhysicsComponent(
            IPhysicsEngine physicsEngine,
            IDebugRenderer debugRenderer,
            [FromParent, RequireExisting] IPhysicalComponent physicalComponent)
        {
            _physicsEngine     = physicsEngine;
            _debugRenderer     = debugRenderer;
            _physicalComponent = physicalComponent;

            TargetVelocity = Vector3.Zero;
            TryJump        = false;
            JumpVelocity   = 0.5f;
            Stiffness      = 0.02f;

            Enabled = true;
        }
コード例 #9
0
        public NetworkSynchronisationComponent(
            IConsoleHandle consoleHandle,
            INetworkEngine networkEngine,
            IUniqueIdentifierAllocator uniqueIdentifierAllocator,
            INetworkMessageSerialization networkMessageSerialization,
            IDebugRenderer debugRenderer)
        {
            _consoleHandle               = consoleHandle;
            _networkEngine               = networkEngine;
            _uniqueIdentifierAllocator   = uniqueIdentifierAllocator;
            _networkMessageSerialization = networkMessageSerialization;
            _debugRenderer               = debugRenderer;

            _clientsEntityIsKnownOn     = new HashSet <MxClientGroup>();
            _synchronisedData           = new Dictionary <string, SynchronisedData>();
            _synchronisedDataToTransmit = new List <SynchronisedData>();

            _enabled = true;
        }
コード例 #10
0
 public void EnableWireframes(IDebugRenderer renderer)
 {
     wrap = new DebugDrawWrapper(renderer);
     btWorld.DebugDrawer = wrap;
 }
コード例 #11
0
 public PhysicsDebugDraw(IRenderContext renderContext, IDebugRenderer debugRenderer, bool isRigidBodyActive)
 {
     _renderContext     = renderContext;
     _debugRenderer     = debugRenderer;
     _isRigidBodyActive = isRigidBodyActive;
 }
コード例 #12
0
 public PhysicsDebugDraw(IRenderContext renderContext, IDebugRenderer debugRenderer, bool isRigidBodyActive)
 {
     _renderContext = renderContext;
     _debugRenderer = debugRenderer;
     _isRigidBodyActive = isRigidBodyActive;
 }
コード例 #13
0
 public DebugDrawWrapper(IDebugRenderer ren)
 {
     this.ren = ren;
 }
コード例 #14
0
 public InspectorDebugDraw(IRenderContext renderContext, IDebugRenderer debugRenderer)
 {
     _renderContext = renderContext;
     _debugRenderer = debugRenderer;
 }
コード例 #15
0
 public void SetUp()
 {
     _debugRenderer = Substitute.For <IDebugRenderer>();
 }
コード例 #16
0
 public PhysicsSystem(PhysicsConfiguration physicsConfiguration, IDebugRenderer debugRenderer)
 {
     _physicsConfiguration = physicsConfiguration;
     _debugRenderer        = debugRenderer;
 }