Esempio n. 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;
        }
Esempio n. 2
0
 public RenderingSystemIntegrationTestsSut(IAssetStore assetStore, IDebugRenderer debugRenderer, IRenderingBackend renderingBackend,
                                           IRenderingSystem renderingSystem)
 {
     AssetStore       = assetStore;
     DebugRenderer    = debugRenderer;
     RenderingBackend = renderingBackend;
     RenderingSystem  = renderingSystem;
 }
 public InspectorGameHostExtension(
     [Optional] IPhysicsEngine physicsEngine,
     IDebugRenderer debugRenderer,
     InspectorRenderPass inspectorRenderPass,
     IConsoleHandle consoleHandle)
 {
     _physicsEngine       = physicsEngine;
     _debugRenderer       = debugRenderer;
     _inspectorRenderPass = inspectorRenderPass;
     _consoleHandle       = consoleHandle;
     _rigidBodyRef        = new WeakReference <RigidBody>(null);
 }
        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>();
        }
Esempio n. 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;
        }
        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;
        }
        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;
        }
        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;
        }
        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;
        }
Esempio n. 10
0
 public void EnableWireframes(IDebugRenderer renderer)
 {
     wrap = new DebugDrawWrapper(renderer);
     btWorld.DebugDrawer = wrap;
 }
Esempio n. 11
0
 public PhysicsDebugDraw(IRenderContext renderContext, IDebugRenderer debugRenderer, bool isRigidBodyActive)
 {
     _renderContext     = renderContext;
     _debugRenderer     = debugRenderer;
     _isRigidBodyActive = isRigidBodyActive;
 }
Esempio n. 12
0
 public PhysicsDebugDraw(IRenderContext renderContext, IDebugRenderer debugRenderer, bool isRigidBodyActive)
 {
     _renderContext = renderContext;
     _debugRenderer = debugRenderer;
     _isRigidBodyActive = isRigidBodyActive;
 }
Esempio n. 13
0
 public DebugDrawWrapper(IDebugRenderer ren)
 {
     this.ren = ren;
 }
 public InspectorDebugDraw(IRenderContext renderContext, IDebugRenderer debugRenderer)
 {
     _renderContext = renderContext;
     _debugRenderer = debugRenderer;
 }
Esempio n. 15
0
 public void SetUp()
 {
     _debugRenderer = Substitute.For <IDebugRenderer>();
 }
Esempio n. 16
0
 public PhysicsSystem(PhysicsConfiguration physicsConfiguration, IDebugRenderer debugRenderer)
 {
     _physicsConfiguration = physicsConfiguration;
     _debugRenderer        = debugRenderer;
 }