Object T3DTriangle
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
Overview
Fields
Methods
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
Generated by PasDoc 0.13.0 on 2013-08-17 21:27:14
|