Beispiel #1
0
        public IEnumerable <Mesh> GetAllMeshesWithTag(string tag)
        {
            GameEntity        gameEntity1 = this;
            List <GameEntity> children    = new List <GameEntity>();

            gameEntity1.GetChildrenRecursive(ref children);
            children.Add(gameEntity1);
            foreach (GameEntity gameEntity2 in children)
            {
                GameEntity entity = gameEntity2;
                for (int i = 0; i < entity.MultiMeshComponentCount; ++i)
                {
                    MetaMesh multiMesh = entity.GetMetaMesh(i);
                    for (int j = 0; j < multiMesh.MeshCount; ++j)
                    {
                        Mesh meshAtIndex = multiMesh.GetMeshAtIndex(j);
                        if (meshAtIndex.HasTag(tag))
                        {
                            yield return(meshAtIndex);
                        }
                    }
                    multiMesh = (MetaMesh)null;
                }
                entity = (GameEntity)null;
            }
        }
 public void BatchMultiMeshes(MetaMesh metaMesh) => EngineApplicationInterface.IMetaMesh.BatchMultiMeshes(this.Pointer, metaMesh.Pointer);
 public void AddMetaMesh(MetaMesh metaMesh) => EngineApplicationInterface.IMetaMesh.AddMetaMesh(this.Pointer, metaMesh.Pointer);
 public void CopyTo(MetaMesh res, bool copyMeshes = true) => EngineApplicationInterface.IMetaMesh.CopyTo(this.Pointer, res.Pointer, copyMeshes);
 public void AddEntityWithMultiMesh(MetaMesh mesh, ref MatrixFrame frame) => EngineApplicationInterface.IScene.AddEntityWithMultiMesh(this.Pointer, mesh.Pointer, ref frame);
 public GameEntity AddItemEntity(ref MatrixFrame placementFrame, MetaMesh metaMesh) => EngineApplicationInterface.IScene.AddItemEntity(this.Pointer, ref placementFrame, metaMesh.Pointer);
Beispiel #7
0
 public void AddMultiMeshToSkeletonBone(MetaMesh metaMesh, sbyte boneIndex) => EngineApplicationInterface.IGameEntity.AddMultiMeshToSkeletonBone(this.Pointer, metaMesh.Pointer, boneIndex);
Beispiel #8
0
 public void AddMultiMeshToSkeleton(MetaMesh metaMesh) => EngineApplicationInterface.IGameEntity.AddMultiMeshToSkeleton(this.Pointer, metaMesh.Pointer);
Beispiel #9
0
 public void RemoveMultiMeshFromSkeleton(MetaMesh metaMesh) => EngineApplicationInterface.IGameEntity.RemoveMultiMeshFromSkeleton(this.Pointer, metaMesh.Pointer);
        internal static void GetObjectField(
            DotNetObject managedObject,
            ref ScriptComponentFieldHolder scriptComponentFieldHolder,
            string fieldName,
            int type)
        {
            Managed.RglScriptFieldType rglScriptFieldType = (Managed.RglScriptFieldType)type;
            FieldInfo fieldOfClass = Managed.GetFieldOfClass(managedObject.GetType().Name, fieldName);

            switch (rglScriptFieldType)
            {
            case Managed.RglScriptFieldType.RglSftString:
                scriptComponentFieldHolder.s = (string)fieldOfClass.GetValue((object)managedObject);
                break;

            case Managed.RglScriptFieldType.RglSftDouble:
                scriptComponentFieldHolder.d = (double)Convert.ChangeType(fieldOfClass.GetValue((object)managedObject), typeof(double));
                break;

            case Managed.RglScriptFieldType.RglSftFloat:
                scriptComponentFieldHolder.f = (float)Convert.ChangeType(fieldOfClass.GetValue((object)managedObject), typeof(float));
                break;

            case Managed.RglScriptFieldType.RglSftBool:
                bool flag = (bool)fieldOfClass.GetValue((object)managedObject);
                scriptComponentFieldHolder.b = flag ? 1 : 0;
                break;

            case Managed.RglScriptFieldType.RglSftInt:
                scriptComponentFieldHolder.i = (int)Convert.ChangeType(fieldOfClass.GetValue((object)managedObject), typeof(int));
                break;

            case Managed.RglScriptFieldType.RglSftVec3:
                Vec3 c = (Vec3)fieldOfClass.GetValue((object)managedObject);
                scriptComponentFieldHolder.v3 = new Vec3(c, c.w);
                break;

            case Managed.RglScriptFieldType.RglSftEntity:
                GameEntity gameEntity = (GameEntity)fieldOfClass.GetValue((object)managedObject);
                scriptComponentFieldHolder.entityPointer = (NativeObject)gameEntity != (NativeObject)null ? (UIntPtr)Convert.ChangeType((object)gameEntity.Pointer, typeof(UIntPtr)) : (UIntPtr)0UL;
                break;

            case Managed.RglScriptFieldType.RglSftTexture:
                Texture texture = (Texture)fieldOfClass.GetValue((object)managedObject);
                scriptComponentFieldHolder.texturePointer = (NativeObject)texture != (NativeObject)null ? (UIntPtr)Convert.ChangeType((object)texture.Pointer, typeof(UIntPtr)) : (UIntPtr)0UL;
                break;

            case Managed.RglScriptFieldType.RglSftMesh:
                MetaMesh metaMesh = (MetaMesh)fieldOfClass.GetValue((object)managedObject);
                scriptComponentFieldHolder.meshPointer = (NativeObject)metaMesh != (NativeObject)null ? (UIntPtr)Convert.ChangeType((object)metaMesh.Pointer, typeof(UIntPtr)) : (UIntPtr)0UL;
                break;

            case Managed.RglScriptFieldType.RglSftEnum:
                scriptComponentFieldHolder.enumValue = fieldOfClass.GetValue((object)managedObject).ToString();
                break;

            case Managed.RglScriptFieldType.RglSftMaterial:
                Material material = (Material)fieldOfClass.GetValue((object)managedObject);
                scriptComponentFieldHolder.materialPointer = (NativeObject)material != (NativeObject)null ? (UIntPtr)Convert.ChangeType((object)material.Pointer, typeof(UIntPtr)) : (UIntPtr)0UL;
                break;

            case Managed.RglScriptFieldType.RglSftMatrixFrame:
                MatrixFrame matrixFrame = (MatrixFrame)fieldOfClass.GetValue((object)managedObject);
                scriptComponentFieldHolder.matrixFrame = matrixFrame;
                break;
            }
        }