Example #1
0
 internal static void ReadStepRecord(ref NativeStream.Reader reader, out ulong nodeId1, out ulong nodeId2, out int stepOffset, out byte progress)
 {
     nodeId1    = reader.Read <ulong>();
     nodeId2    = reader.Read <ulong>();
     stepOffset = reader.Read <int>();
     progress   = reader.Read <byte>();
 }
        protected sealed override void OnUpdate()
        {
            Dependency = JobHandle.CombineDependencies(Dependency, TriggerJobHandle);

            // If the producer did not actually write anything to the stream, the native stream will not be flaged as created.
            // In that case we don't need to do anything.
            // Not doing this checks actually result in a non authrorized access to the memory and crashes Unity.
            if (!_effectStream.IsCreated)
            {
                return;
            }
            NativeStream.Reader effectReader = GetEffectReader();
            SetupEffectMap      AllocateJob  = new SetupEffectMap()
            {
                EffectReader = effectReader,
                Effects      = _effects
            };

            Dependency = AllocateJob.Schedule(Dependency);


            NativeMultiHashMap <Entity, EFFECT_CTX> .ParallelWriter effectsWriter = _effects.AsParallelWriter();
            RemapEffects RemapEffectsJob = new RemapEffects()
            {
                EffectReader  = effectReader,
                EffectsWriter = _effects.AsParallelWriter()
            };

            Dependency = RemapEffectsJob.Schedule(_forEachCount, 1, Dependency);

            // Call the effect consumption logic defined in hte derived class.
            Consume();

            Dependency = _effectStream.Dispose(Dependency);
        }
Example #3
0
        unsafe static void SolveSingleJoint(JointData *jointData, int numIterations, float timestep,
                                            ref MotionVelocity velocityA, ref MotionVelocity velocityB, ref MotionData motionA, ref MotionData motionB, out NativeStream jacobiansOut)
        {
            var stepInput = new Solver.StepInput
            {
                IsLastIteration        = false,
                InvNumSolverIterations = 1.0f / numIterations,
                Timestep    = timestep,
                InvTimestep = timestep > 0.0f ? 1.0f / timestep : 0.0f
            };

            // Build jacobians
            jacobiansOut = new NativeStream(1, Allocator.Temp);
            {
                NativeStream.Writer jacobianWriter = jacobiansOut.AsWriter();
                jacobianWriter.BeginForEachIndex(0);
                Solver.BuildJointJacobian(jointData, new BodyIndexPair(), velocityA, velocityB, motionA, motionB, timestep, numIterations, ref jacobianWriter);
                jacobianWriter.EndForEachIndex();
            }

            var eventWriter = new NativeStream.Writer(); // no events expected

            // Solve the joint
            for (int iIteration = 0; iIteration < numIterations; iIteration++)
            {
                stepInput.IsLastIteration = (iIteration == numIterations - 1);
                NativeStream.Reader jacobianReader = jacobiansOut.AsReader();
                var jacIterator = new JacobianIterator(jacobianReader, 0);
                while (jacIterator.HasJacobiansLeft())
                {
                    ref JacobianHeader header = ref jacIterator.ReadJacobianHeader();
                    header.Solve(ref velocityA, ref velocityB, stepInput, ref eventWriter, ref eventWriter);
                }
            }
 public void ReadTriggeredPort(ref NativeStream.Reader reader, out OutputTriggerPort triggeredPort)
 {
     triggeredPort = new OutputTriggerPort {
         Port = new Port {
             Index = reader.Read <uint>()
         }
     };
 }
Example #5
0
    // TODO value has to be a struct because record<T:struct>(T value)
    /// <summary>
    /// Reads the node value from the GraphStream's underlying NativeStream. Given that the Record method has a struct
    /// constraint on the value, this method is safe
    /// </summary>
    /// <param name="valueType"></param>
    /// <param name="reader"></param>
    /// <returns></returns>
    static unsafe object ReadValueFromNode(Type valueType, ref NativeStream.Reader reader)
    {
        int    size  = UnsafeUtility.SizeOf(valueType);
        byte * ptr   = reader.ReadUnsafePtr(size);
        object value = Marshal.PtrToStructure(new IntPtr(ptr), valueType);

        return(value);
    }
 public void ReadReadValue(ref NativeStream.Reader reader, out Value value, out InputDataPort inputDataPort)
 {
     inputDataPort = new InputDataPort {
         Port = new Port {
             Index = reader.Read <uint>()
         }
     };
     value = reader.Read <Value>();
 }
 public void ReadWrittenValue(ref NativeStream.Reader reader, out Value value, out OutputDataPort outputDataPort)
 {
     outputDataPort = new OutputDataPort {
         Port = new Port {
             Index = reader.Read <uint>()
         }
     };
     value = reader.Read <Value>();
 }
Example #8
0
            internal Enumerator(NativeStream stream)
            {
                m_Reader          = stream.IsCreated ? stream.AsReader() : new NativeStream.Reader();
                m_CurrentWorkItem = 0;
                m_NumWorkItems    = stream.IsCreated ? stream.ForEachCount : 0;
                Current           = default;

                AdvanceReader();
            }
Example #9
0
    internal static void ReadValueRecord(ref NativeStream.Reader reader, out ulong nodeId1, out ulong nodeId2, out object value)
    {
        nodeId1 = reader.Read <ulong>();
        nodeId2 = reader.Read <ulong>();
        RuntimeTypeHandle typeHandle = reader.Read <RuntimeTypeHandle>();
        Type type = Type.GetTypeFromHandle(typeHandle);

        value = ReadValueFromNode(type, ref reader);
    }
Example #10
0
 public static unsafe void ReadArrayAndEnsureSize <T>([NoAlias] ref NativeStream.Reader nativeStream, [NoAlias] ref NativeArray <T> array, out int length) where T : unmanaged
 {
     length = nativeStream.Read <int>();
     NativeCollectionHelpers.EnsureMinimumSize(ref array, length);
     for (int i = 0; i < length; i++)
     {
         array[i] = nativeStream.Read <T>();
     }
 }
Example #11
0
            internal Enumerator(NativeStream stream, NativeSlice <RigidBody> bodies)
            {
                m_Reader          = stream.IsCreated ? stream.AsReader() : new NativeStream.Reader();
                m_CurrentWorkItem = 0;
                m_NumWorkItems    = stream.IsCreated ? stream.ForEachCount : 0;
                Current           = default;

                m_Bodies = bodies;

                AdvanceReader();
            }
Example #12
0
        public void JacobianIteratorHasJacobiansLeftTest()
        {
            var jacobianStream = new NativeStream(1, Allocator.Temp);

            NativeStream.Reader jacobianStreamReader = jacobianStream.AsReader();
            int workItemIndex = 0;
            var jacIterator   = new JacobianIterator(jacobianStreamReader, workItemIndex);

            Assert.IsFalse(jacIterator.HasJacobiansLeft());

            jacobianStream.Dispose();
        }
Example #13
0
        // Build Jacobians from the contacts and joints stored in the simulation context
        public static void BuildJacobians(ref PhysicsWorld world,
                                          float timeStep, float3 gravity, int numSolverIterations,
                                          NativeArray <DispatchPairSequencer.DispatchPair> dispatchPairs,
                                          ref NativeStream.Reader contactsReader, ref NativeStream.Writer jacobiansWriter)
        {
            contactsReader.BeginForEachIndex(0);
            jacobiansWriter.BeginForEachIndex(0);
            float invTimeStep         = timeStep > 0.0f ? 1.0f / timeStep : 0.0f;
            float gravityAcceleration = math.length(gravity);

            BuildJacobians(ref world, timeStep, invTimeStep, gravityAcceleration, numSolverIterations,
                           new NativeSlice <DispatchPairSequencer.DispatchPair>(dispatchPairs, 0, dispatchPairs.Length), ref contactsReader, ref jacobiansWriter);
        }
        internal bool ReadDebuggingDataModel(ref NativeStream.Reader reader, EntityFrameData entityFrameData, out TracingStep tracingStep)
        {
            tracingStep = default;
            IPortModel portModel;

            switch (reader.Read <DotsFrameTrace.StepType>())
            {
            case DotsFrameTrace.StepType.ExecutedNode:
                entityFrameData.FrameTrace.ReadExecutedNode(ref reader, out NodeId id, out byte progress);
                if (!NodeMapping.TryGetValue(id, out var nodeModel))
                {
                    return(false);
                }
                tracingStep = TracingStep.ExecutedNode(nodeModel, progress);
                break;

            case DotsFrameTrace.StepType.TriggeredPort:
                entityFrameData.FrameTrace.ReadTriggeredPort(ref reader, out OutputTriggerPort triggeredPort);
                if (!PortMapping.TryGetValue(triggeredPort.Port.Index, out portModel))
                {
                    return(false);
                }
                tracingStep = TracingStep.TriggeredPort(portModel);
                break;

            case DotsFrameTrace.StepType.WrittenValue:
                entityFrameData.FrameTrace.ReadWrittenValue(ref reader, out Value writtenValue,
                                                            out OutputDataPort outputDataPort);
                if (!PortMapping.TryGetValue(outputDataPort.Port.Index, out portModel))
                {
                    return(false);
                }
                tracingStep = TracingStep.WrittenValue(portModel, writtenValue.ToPrettyString());
                break;

            case DotsFrameTrace.StepType.ReadValue:
                entityFrameData.FrameTrace.ReadReadValue(ref reader, out Value readValue, out InputDataPort inputDataPort);
                if (!PortMapping.TryGetValue(inputDataPort.Port.Index, out portModel))
                {
                    return(false);
                }
                tracingStep = TracingStep.ReadValue(portModel, readValue.ToPrettyString());
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            return(true);
        }
Example #15
0
        private void Draw()
        {
            for (int i = 0; i < m_DebugStreams.Count; i++)
            {
                NativeStream.Reader reader = m_DebugStreams[i].AsReader();
                for (int j = 0; j != reader.ForEachCount; j++)
                {
                    reader.BeginForEachIndex(j);
                    while (reader.RemainingItemCount != 0)
                    {
                        switch (reader.Read <Type>())
                        {
                        case Type.Polygon:
                            reader.Read <Polygon>().Draw();
                            continue;

                        case Type.Circle:
                            reader.Read <Circle>().Draw();
                            continue;

                        case Type.Box:
                            reader.Read <Box>().Draw();
                            continue;

                        case Type.Arc:
                            reader.Read <Arc>().Draw();
                            continue;

                        case Type.Point:
                            reader.Read <Point>().Draw();
                            continue;

                        case Type.Line:
                            reader.Read <Line>().Draw();
                            continue;

                        case Type.Text:
                            reader.Read <Text>().Draw(ref reader);
                            continue;

                        default:
                            return;
                        }
                    }
                    reader.EndForEachIndex();
                }
            }
        }
Example #16
0
        public void Draw(ref NativeStream.Reader reader)
        {
            // Read string data.
            char[] stringBuf = new char[Length];
            for (int i = 0; i < Length; i++)
            {
                stringBuf[i] = reader.Read <char>();
            }

            GUIStyle style = new GUIStyle();

            style.normal.textColor = Color;
#if UNITY_EDITOR
            Handles.Label(X, new string(stringBuf), style);
#endif
        }
Example #17
0
 private static void BuildContactJacobian(
     int contactPointIndex,
     float3 normal,
     MTransform worldFromA,
     MTransform worldFromB,
     float invTimestep,
     MotionVelocity velocityA,
     MotionVelocity velocityB,
     float sumInvMass,
     float maxDepenetrationVelocity,
     ref JacobianHeader jacobianHeader,
     ref float3 centerA,
     ref float3 centerB,
     ref NativeStream.Reader contactReader)
 {
     ref ContactJacAngAndVelToReachCp jacAngular = ref jacobianHeader.AccessAngularJacobian(contactPointIndex);
Example #18
0
        // Solve the Jacobians stored in the simulation context
        public static void SolveJacobians(ref NativeStream.Reader jacobiansReader, NativeSlice <MotionVelocity> motionVelocities, float timeStep, int numIterations,
                                          ref NativeStream.Writer collisionEventsWriter, ref NativeStream.Writer triggerEventsWriter)
        {
            float invNumIterations = math.rcp(numIterations);
            float invTimeStep      = timeStep > 0.0f ? 1.0f / timeStep : 0.0f;

            for (int solverIterationId = 0; solverIterationId < numIterations; solverIterationId++)
            {
                var stepInput = new StepInput
                {
                    InvNumSolverIterations = invNumIterations,
                    IsLastIteration        = solverIterationId == numIterations - 1,
                    Timestep    = timeStep,
                    InvTimestep = invTimeStep
                };

                Solve(motionVelocities, ref jacobiansReader, ref collisionEventsWriter, ref triggerEventsWriter, 0, stepInput);
            }
        }
Example #19
0
    private void Draw()
    {
        for (int i = 0; i < m_DebugStreams.Count; i++)
        {
            NativeStream.Reader reader = m_DebugStreams[i].AsReader();
            for (int j = 0; j != reader.ForEachCount; j++)
            {
                reader.BeginForEachIndex(j);
                while (reader.RemainingItemCount != 0)
                {
                    switch (reader.Read <Type>())
                    {
                    case Type.Point: reader.Read <Point>().Draw(); break;

                    case Type.Line: reader.Read <Line>().Draw(); break;

                    case Type.Arrow: reader.Read <Line>().DrawArrow(); break;

                    case Type.Plane: reader.Read <Line>().DrawPlane(); break;

                    case Type.Circle: reader.Read <Line>().DrawCircle(); break;

                    case Type.Arc: reader.Read <Arc>().Draw(); break;

                    case Type.Cone: reader.Read <Cone>().Draw(); break;

                    case Type.Text: reader.Read <Text>().Draw(ref reader); break;

                    case Type.Box: reader.Read <Box>().Draw(); break;

                    default: return;     // unknown type
                    }
                }
                reader.EndForEachIndex();
            }
        }
#if UNITY_EDITOR
        Unity.DebugDisplay.DebugDisplay.Render();
        Unity.DebugDisplay.DebugDisplay.Clear();
#endif
    }
        void Update()
        {
            Vector3 imageCenter = transform.TransformPoint(new Vector3(0, 0, -ImagePlane));

            if (ExpectingResults)
            {
                NativeStream.Reader reader = lastResults.PixelData.AsReader();
                for (int i = 0; i < lastResults.PixelData.ForEachCount; i++)
                {
                    reader.BeginForEachIndex(i);
                    while (reader.RemainingItemCount > 0)
                    {
                        int   x = reader.Read <int>();
                        int   y = reader.Read <int>();
                        Color c = reader.Read <Color>();
                        blasterTexture.SetPixel(x, y, c);
                    }
                    reader.EndForEachIndex();
                }

                blasterTexture.Apply();
                lastResults.PixelData.Dispose();
                ExpectingResults = false;
            }

            if (BasePhysicsDemo.DefaultWorld == null)
            {
                return;
            }

            RayTracerSystem rbs = BasePhysicsDemo.DefaultWorld.GetExistingSystem <RayTracerSystem>();

            if (rbs == null || !rbs.IsEnabled)
            {
                return;
            }

            Vector3    lightDir   = new Vector3(0, 0, -1);
            GameObject sceneLight = GameObject.Find("Directional Light");

            if (sceneLight != null)
            {
                lightDir = sceneLight.transform.rotation * lightDir;
            }

            Vector3 up    = transform.rotation * new Vector3(0, 1, 0);
            Vector3 right = transform.rotation * new Vector3(1, 0, 0);

            lastResults = rbs.AddRequest(new RayTracerSystem.RayRequest
            {
                PinHole          = transform.position,
                ImageCenter      = imageCenter,
                Up               = up,
                Right            = right,
                LightDir         = lightDir,
                RayLength        = RayLength,
                PlaneHalfExtents = planeHalfExtents,
                AmbientLight     = AmbientLight,
                ImageResolution  = ImageRes,
                AlternateKeys    = AlternateKeys,
                CastSphere       = CastSphere,
                Shadows          = Shadows,
                CollisionFilter  = CollisionFilter.Default
            });
            ExpectingResults = true;
        }
Example #21
0
 internal static Entity ReadEntity(ref NativeStream.Reader reader)
 {
     return(reader.Read <Entity>());
 }
Example #22
0
 public static unsafe void Read <T>([NoAlias] ref NativeStream.Reader nativeStream, [NoAlias] ref T item) where T : unmanaged
 {
     item = nativeStream.Read <T>();
 }
        public unsafe void OverlapTaskFilteringTest([Values(2, 10, 33, 100)] int elementCount)
        {
            elementCount *= 2;
            int numNodes = elementCount + Constants.MaxNumTreeBranches;

            var points      = new NativeArray <PointAndIndex>(elementCount, Allocator.Temp, NativeArrayOptions.UninitializedMemory);
            var aabbs       = new NativeArray <Aabb>(elementCount, Allocator.Temp, NativeArrayOptions.UninitializedMemory);
            var bodyFilters = new NativeArray <CollisionFilter>(elementCount, Allocator.Temp, NativeArrayOptions.UninitializedMemory);

            InitInputWithCopyArrays(points, aabbs, bodyFilters);

            var   nodes    = new NativeArray <Node>(numNodes, Allocator.Temp, NativeArrayOptions.UninitializedMemory);
            Node *nodesPtr = (Node *)nodes.GetUnsafePtr();

            var seenUnfiltered = new HashSet <BodyIndexPair>();
            {
                var bvhUnfiltered = new BoundingVolumeHierarchy(nodes);
                bvhUnfiltered.Build(points, aabbs, out int numNodesOut);
                bvhUnfiltered.CheckIntegrity();

                EverythingWriter pairWriter = new EverythingWriter {
                    SeenPairs = seenUnfiltered
                };
                BoundingVolumeHierarchy.TreeOverlap(ref pairWriter, nodesPtr, nodesPtr);
            }

            var nodeFilters = new NativeArray <CollisionFilter>(numNodes, Allocator.Temp, NativeArrayOptions.UninitializedMemory);
            var bvhFiltered = new BoundingVolumeHierarchy(nodes, nodeFilters);
            int numNodesFilteredTree;

            bvhFiltered.Build(points, aabbs, out numNodesFilteredTree);
            bvhFiltered.BuildCombinedCollisionFilter(bodyFilters, 0, numNodesFilteredTree - 1);

            var filteredCollisionPairs = new NativeStream(1, Allocator.TempJob);

            NativeStream.Writer filteredPairWriter = filteredCollisionPairs.AsWriter();
            filteredPairWriter.BeginForEachIndex(0);
            CollisionFilter *bodyFiltersPtr = (CollisionFilter *)bodyFilters.GetUnsafePtr();
            var bufferedPairs = new Broadphase.BodyPairWriter(&filteredPairWriter, bodyFiltersPtr, bodyFiltersPtr, 0, 0);

            CollisionFilter *nodeFiltersPtr = (CollisionFilter *)nodeFilters.GetUnsafePtr();

            BoundingVolumeHierarchy.TreeOverlap(ref bufferedPairs, nodesPtr, nodesPtr, nodeFiltersPtr, nodeFiltersPtr);
            bufferedPairs.Close();
            filteredPairWriter.EndForEachIndex();

            NativeStream.Reader filteredPairReader = filteredCollisionPairs.AsReader();
            filteredPairReader.BeginForEachIndex(0);

            // Check that every pair in our filtered set also appears in the unfiltered set
            while (filteredPairReader.RemainingItemCount > 0)
            {
                var pair = filteredPairReader.Read <BodyIndexPair>();

                Assert.IsTrue(seenUnfiltered.Contains(pair));
                seenUnfiltered.Remove(pair); // Remove the pair
            }

            // Pairs were removed, so the only remaining ones should be filtered
            foreach (BodyIndexPair pair in seenUnfiltered)
            {
                bool shouldCollide = CollisionFilter.IsCollisionEnabled(bodyFilters[pair.BodyIndexA], bodyFilters[pair.BodyIndexB]);
                Assert.IsFalse(shouldCollide);
            }

            nodeFilters.Dispose();
            nodes.Dispose();
            bodyFilters.Dispose();
            aabbs.Dispose();
            points.Dispose();
            filteredCollisionPairs.Dispose();
        }
        public void OnlyTriggerEffectOfActiveSkill([Values(AbilityState.CooledDown, AbilityState.CoolingDown, AbilityState.Casting)] AbilityState state)
        {
            // Arrange
            Entity caster = _entityManager.CreateEntity();

            _entityManager.AddComponentData(caster, new Target()
            {
                Value = Entity.Null
            });

            _entityManager.AddComponentData(caster, new TestResource()
            {
                Value = 20
            });

            Ability ability = new Ability(1, 1, new Range())
            {
                State = AbilityState.Active
            };

            DynamicBuffer <AbilityBuffer> abilityBuffer = _entityManager.AddBuffer <AbilityBuffer>(caster);

            abilityBuffer.Add(new AbilityBuffer()
            {
                Ability = ability
            });
            abilityBuffer.Add(new AbilityBuffer()
            {
                Ability = new Ability(1, 1, new Range())
                {
                    State = state
                }
            });

            DynamicBuffer <TestEffectBuffer> testEffectBuffer = _entityManager.AddBuffer <TestEffectBuffer>(caster);

            testEffectBuffer.Add(new TestEffectBuffer()
            {
                AbilityIndex = 0,
                Effect       = new TestEffect()
                {
                    Affects = EffectAffectType.Target,
                    Value   = 1
                }
            });
            testEffectBuffer.Add(new TestEffectBuffer()
            {
                AbilityIndex = 1,
                Effect       = new TestEffect()
                {
                    Affects = EffectAffectType.Target,
                    Value   = 1
                }
            });

            _world.WithSystem <TestEffectTriggerSystem>();

            //Act
            _world.UpdateSystem <TestEffectTriggerSystem>();
            _world.CompleteAllJobs();

            //Assert
            TestEffectConsumerSystem conusmerSystem = _world.GetReference().GetExistingSystem <TestEffectConsumerSystem>();

            NativeStream.Reader reader = conusmerSystem.GetEffectReader();
            Assert.AreEqual(1, conusmerSystem.GetEffectReader().ComputeItemCount());
            reader.BeginForEachIndex(0);
            TestEffectContext ctx = reader.Read <TestEffectContext>();

            Assert.AreEqual(Entity.Null, ctx.Target);
            Assert.AreEqual(EffectAffectType.Target, ctx.Effect.Affects);
            Assert.AreEqual(1, ctx.Effect.Value);
            Assert.AreEqual(20, ctx.testResourceValue);
            reader.EndForEachIndex();
        }
 public void ReadExecutedNode(ref NativeStream.Reader reader, out NodeId nodeId, out byte progress)
 {
     nodeId   = new NodeId(reader.Read <uint>());
     progress = reader.Read <byte>();
 }
 public static int Count(this NativeStream.Reader reader) => reader.ComputeItemCount();
Example #27
0
        void Update()
        {
            if (World.DefaultGameObjectInjectionWorld == null)
            {
                return;
            }

            RayTracerSystem rbs = World.DefaultGameObjectInjectionWorld.GetExistingSystem <RayTracerSystem>();

            if (rbs == null || !rbs.IsEnabled || !rbs.GetOutputDependency().IsCompleted)
            {
                return;
            }

            if (nextResults.PixelData.IsCreated)
            {
                // rbs.GetOutputDependency().IsCompleted is true here
                // so this is only needed to quieten the JobsDebugger?
                rbs.GetOutputDependency().Complete();

                NativeStream.Reader reader = nextResults.PixelData.AsReader();
                for (int i = 0; i < nextResults.PixelData.ForEachCount; i++)
                {
                    reader.BeginForEachIndex(i);
                    while (reader.RemainingItemCount > 0)
                    {
                        int   x = reader.Read <int>();
                        int   y = reader.Read <int>();
                        Color c = reader.Read <Color>();
                        blasterTexture.SetPixel(x, y, c);
                    }
                    reader.EndForEachIndex();
                }

                blasterTexture.Apply();

                // NOTE: If this logic is moved to the likes of LateUpdate there will be order issues
                // with the RayTracerSystem.OnUpdate function as PixelData will be invalid.
                nextResults.Dispose();
            }

            Vector3 imageCenter = transform.TransformPoint(new Vector3(0, 0, -ImagePlane));

            Vector3    lightDir   = new Vector3(0, 0, -1);
            GameObject sceneLight = GameObject.Find("Directional Light");

            if (sceneLight != null)
            {
                lightDir = sceneLight.transform.rotation * lightDir;
            }

            Vector3 up    = transform.rotation * new Vector3(0, 1, 0);
            Vector3 right = transform.rotation * new Vector3(1, 0, 0);

            nextResults = rbs.AddRequest(new RayTracerSystem.RayRequest
            {
                PinHole          = transform.position,
                ImageCenter      = imageCenter,
                Up               = up,
                Right            = right,
                LightDir         = lightDir,
                RayLength        = RayLength,
                PlaneHalfExtents = planeHalfExtents,
                AmbientLight     = AmbientLight,
                ImageResolution  = imageRes,
                AlternateKeys    = AlternateKeys,
                CastSphere       = CastSphere,
                Shadows          = Shadows,
                CollisionFilter  = CollisionFilter.Default
            });
        }