TODO: https://stackoverflow.com/questions/21640545/how-to-check-for-convexity-of-a-3d-mesh func (g *Geometry) IsConvex() bool { { ApplyMatrix multiplies each of the geometry position vertices by the specified matrix and apply the correspondent normal transform matrix to the geometry normal vectors.
(m *math32.Matrix4)
| 464 | // transform matrix to the geometry normal vectors. |
| 465 | // The geometry's bounding box and sphere are recomputed if needed. |
| 466 | func (g *Geometry) ApplyMatrix(m *math32.Matrix4) { |
| 467 | |
| 468 | // Apply matrix to all vertices |
| 469 | g.OperateOnVertices(func(vertex *math32.Vector3) bool { |
| 470 | vertex.ApplyMatrix4(m) |
| 471 | return false |
| 472 | }) |
| 473 | |
| 474 | // Apply normal matrix to all normal vectors |
| 475 | var normalMatrix math32.Matrix3 |
| 476 | normalMatrix.GetNormalMatrix(m) |
| 477 | g.OperateOnVertexNormals(func(normal *math32.Vector3) bool { |
| 478 | normal.ApplyMatrix3(&normalMatrix).Normalize() |
| 479 | return false |
| 480 | }) |
| 481 | } |
| 482 | |
| 483 | // Incref increments the reference count for this geometry |
| 484 | // and returns a pointer to the geometry. |
nothing calls this directly
no test coverage detected