Castle Game Engine: CastleTriangles: Object T3DTriangle

# Object T3DTriangle
Description | Hierarchy | Fields | Methods | Properties
## Unit CastleTriangles ## Declaration `type T3DTriangle = object(TObject)` ## Description 3D triangle. This object should always be initialized by Init, and updated only by it's methods (never modify fields of this object directly). I use old-style Pascal "object" to define this, since this makes it a little more efficient. This doesn't need any virtual methods or such, so (at least for now) it's easier and more memory-efficient to keep this as an old-style object. And memory efficiency is somewhat important here, since large scenes may easily have milions of triangles, and each triangle results in one TTriangle (descendant of `T3DTriangle`) instance. ## Hierarchy TObject T3DTriangle ## Overview ### Fields
| `Local: T3DTriangleGeometry;`
| `World: T3DTriangleGeometry;`
### Methods
| `constructor Init(const ATriangle: TTriangle3Single);`
## Description ### Fields
| `Local: T3DTriangleGeometry;`
Geometry of this item. We need two geometry descriptions: Local is based on initial Triangle, given when constructing this T3DTriangle. It's constant for this T3DTriangle. It's used by octree collision routines, that is things like TBaseTrianglesOctree.SphereCollision, TBaseTrianglesOctree.RayCollision and such expect parameters in the same coord space. This may be local coord space of this shape (this is used by TShape.OctreeTriangles) or world coord space (this is used by TCastleSceneCore.OctreeTriangles). World is the geometry of Local transformed to be in world coordinates. Initially, World is just a copy of Local. If Local already contains world-space geometry, then World can just remain constant, and so is always Local copy. If Local contains local shape-space geometry, then World will have to be updated by TTriangle.UpdateWorld whenever some octree item's geometry will be needed in world coords. This will have to be done e.g. by TBaseTrianglesOctree.XxxCollision for each returned item.
| `World: T3DTriangleGeometry;`
Geometry of this item. We need two geometry descriptions: Local is based on initial Triangle, given when constructing this T3DTriangle. It's constant for this T3DTriangle. It's used by octree collision routines, that is things like TBaseTrianglesOctree.SphereCollision, TBaseTrianglesOctree.RayCollision and such expect parameters in the same coord space. This may be local coord space of this shape (this is used by TShape.OctreeTriangles) or world coord space (this is used by TCastleSceneCore.OctreeTriangles). World is the geometry of Local transformed to be in world coordinates. Initially, World is just a copy of Local. If Local already contains world-space geometry, then World can just remain constant, and so is always Local copy. If Local contains local shape-space geometry, then World will have to be updated by TTriangle.UpdateWorld whenever some octree item's geometry will be needed in world coords. This will have to be done e.g. by TBaseTrianglesOctree.XxxCollision for each returned item.
### Methods
| `constructor Init(const ATriangle: TTriangle3Single);`
Initialize new triangle. Given ATriangle must satisfy IsValidTriangle.
Generated by PasDoc 0.13.0 on 2015-06-15 04:43:12