Annotation of /trunk/RexDotMeshLoader/OMesh.cs
Parent Directory
|
Revision Log
Revision 48 - (view) (download)
| 1 : | tuco | 48 | /* |
| 2 : | Modified .mesh loader based on the Axiom Graphics Engine Library | ||
| 3 : | which is based on the open source Object Oriented Graphics Engine OGRE. | ||
| 4 : | |||
| 5 : | RexDotMeshLoader by realXtend project. | ||
| 6 : | |||
| 7 : | Axiom Graphics Engine Library | ||
| 8 : | Copyright (C) 2003-2006 Axiom Project Team | ||
| 9 : | The overall design, and a majority of the core engine and rendering code | ||
| 10 : | contained within this library is a derivative of the open source Object Oriented | ||
| 11 : | Graphics Engine OGRE, which can be found at http://ogre.sourceforge.net. | ||
| 12 : | Many thanks to the OGRE team for maintaining such a high quality project. | ||
| 13 : | |||
| 14 : | This library is free software; you can redistribute it and/or | ||
| 15 : | modify it under the terms of the GNU Lesser General Public | ||
| 16 : | License as published by the Free Software Foundation; either | ||
| 17 : | version 2.1 of the License, or (at your option) any later version. | ||
| 18 : | |||
| 19 : | This library is distributed in the hope that it will be useful, | ||
| 20 : | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 21 : | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 22 : | Lesser General Public License for more details. | ||
| 23 : | */ | ||
| 24 : | |||
| 25 : | using System; | ||
| 26 : | using System.Collections; | ||
| 27 : | using System.Collections.Generic; | ||
| 28 : | |||
| 29 : | namespace RexDotMeshLoader | ||
| 30 : | { | ||
| 31 : | public class MeshLodUsage { } | ||
| 32 : | public class MeshLodUsageList { } | ||
| 33 : | |||
| 34 : | public class OMesh | ||
| 35 : | { | ||
| 36 : | protected string name; | ||
| 37 : | public VertexData SharedVertexData; | ||
| 38 : | public List<SubMesh> subMeshList = new List<SubMesh>(); | ||
| 39 : | public bool IsManuallyDefined = false; | ||
| 40 : | public bool isLodManual; | ||
| 41 : | public float BoundingSphereRadius; | ||
| 42 : | |||
| 43 : | public Vector3 boundingBoxMin, boundingBoxMax; | ||
| 44 : | |||
| 45 : | // skeletons removed. | ||
| 46 : | |||
| 47 : | // lod | ||
| 48 : | protected internal int numLods; | ||
| 49 : | protected internal MeshLodUsageList lodUsageList = new MeshLodUsageList(); | ||
| 50 : | |||
| 51 : | public OMesh(string vName) | ||
| 52 : | { | ||
| 53 : | name = vName; | ||
| 54 : | } | ||
| 55 : | |||
| 56 : | public SubMesh GetSubMesh(int index) | ||
| 57 : | { | ||
| 58 : | if (index < subMeshList.Count) | ||
| 59 : | return subMeshList[index]; | ||
| 60 : | else | ||
| 61 : | return null; | ||
| 62 : | } | ||
| 63 : | |||
| 64 : | /* | ||
| 65 : | public SubMesh GetSubMesh( string name ) | ||
| 66 : | { | ||
| 67 : | for(int i = 0; i < subMeshList.Count; i++ ) | ||
| 68 : | { | ||
| 69 : | if (subMeshList[i].name == name) | ||
| 70 : | { | ||
| 71 : | return subMeshList[i]; | ||
| 72 : | } | ||
| 73 : | } | ||
| 74 : | throw new Exception("Submesh not found with name "+name); | ||
| 75 : | } | ||
| 76 : | */ | ||
| 77 : | |||
| 78 : | public SubMesh CreateSubMesh(string vName) | ||
| 79 : | { | ||
| 80 : | SubMesh subMesh = new SubMesh(vName); | ||
| 81 : | subMesh.Parent = this; | ||
| 82 : | subMeshList.Add(subMesh); | ||
| 83 : | |||
| 84 : | return subMesh; | ||
| 85 : | } | ||
| 86 : | |||
| 87 : | public SubMesh CreateSubMesh() | ||
| 88 : | { | ||
| 89 : | string tempname = string.Format( "{0}_SubMesh(1)", this.name, subMeshList.Count ); | ||
| 90 : | |||
| 91 : | SubMesh subMesh = new SubMesh(tempname); | ||
| 92 : | subMesh.Parent = this; | ||
| 93 : | subMeshList.Add(subMesh); | ||
| 94 : | |||
| 95 : | return subMesh; | ||
| 96 : | } | ||
| 97 : | } | ||
| 98 : | } |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

