Geometry encapsulates a three-dimensional vertex-based geometry.
| 26 | |
| 27 | // Geometry encapsulates a three-dimensional vertex-based geometry. |
| 28 | type Geometry struct { |
| 29 | gs *gls.GLS // Reference to OpenGL state (valid after first RenderSetup) |
| 30 | refcount int // Current number of references |
| 31 | groups []Group // Array geometry groups |
| 32 | vbos []*gls.VBO // Array of VBOs |
| 33 | handleVAO uint32 // Handle to OpenGL VAO |
| 34 | indices math32.ArrayU32 // Buffer with indices |
| 35 | handleIndices uint32 // Handle to OpenGL buffer for indices |
| 36 | updateIndices bool // Flag to indicate that indices must be transferred |
| 37 | ShaderDefines gls.ShaderDefines // Geometry-specific shader defines |
| 38 | |
| 39 | // Geometric properties |
| 40 | boundingBox math32.Box3 // Last calculated bounding box |
| 41 | boundingSphere math32.Sphere // Last calculated bounding sphere |
| 42 | area float32 // Last calculated area |
| 43 | volume float32 // Last calculated volume |
| 44 | rotInertia math32.Matrix3 // Last calculated rotational inertia matrix |
| 45 | |
| 46 | // Flags indicating whether geometric properties are valid |
| 47 | boundingBoxValid bool // Indicates if last calculated bounding box is valid |
| 48 | boundingSphereValid bool // Indicates if last calculated bounding sphere is valid |
| 49 | areaValid bool // Indicates if last calculated area is valid |
| 50 | volumeValid bool // Indicates if last calculated volume is valid |
| 51 | rotInertiaValid bool // Indicates if last calculated rotational inertia matrix is valid |
| 52 | } |
| 53 | |
| 54 | // Group is a geometry group object. |
| 55 | type Group struct { |
nothing calls this directly
no outgoing calls
no test coverage detected