public override void DrawBox(ref Vector3 bbMin, ref Vector3 bbMax, ref Vector3 color) { UnityEngine.Bounds b = new UnityEngine.Bounds(bbMin.ToUnity(), UnityEngine.Vector3.zero); b.Encapsulate(bbMax.ToUnity()); UnityEngine.Gizmos.color = new UnityEngine.Color(color.X, color.Y, color.Z); UnityEngine.Gizmos.DrawWireCube(b.center, b.size); }
public void Execute(ArchetypeChunk batchInChunk, int batchIndex) { bool chunkHasChanges = batchInChunk.DidChange(LocalToWorldTypeHandleInfo, L2WChangeVersion); if (!chunkHasChanges) { return; // early out if the chunk transforms haven't changed } NativeArray <LocalToWorld> transforms = batchInChunk.GetNativeArray <LocalToWorld>(LocalToWorldTypeHandleInfo); UnityEngine.Bounds bounds = new UnityEngine.Bounds(); bounds.center = transforms[0].Position; for (int i = 1; i < transforms.Length; i++) { bounds.Encapsulate(transforms[i].Position); } batchInChunk.SetChunkComponentData( ChunkAabbTypeHandleInfo, new ChunkAABB() { Value = bounds.ToAABB() }); }
public override void DrawBox(ref Vector3 bbMin, ref Vector3 bbMax, ref Vector3 color) { UnityEngine.Bounds b = new UnityEngine.Bounds(bbMin.ToUnity(), UnityEngine.Vector3.zero); b.Encapsulate(bbMax.ToUnity()); UnityEngine.Gizmos.color = new UnityEngine.Color(color.X, color.Y, color.Z); UnityEngine.Gizmos.DrawWireCube(b.center,b.size); }
static StackObject *Encapsulate_4(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); UnityEngine.Bounds @bounds = (UnityEngine.Bounds) typeof(UnityEngine.Bounds).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method); UnityEngine.Bounds instance_of_this_method = (UnityEngine.Bounds) typeof(UnityEngine.Bounds).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); instance_of_this_method.Encapsulate(@bounds); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method); __intp.Free(ptr_of_this_method); return(__ret); }