Main comment stating the purpose of this class and relevant relationship to other classes. Possible useful expressions for doIt or printIt. Structure: instVar1 type -- comment about the purpose of instVar1 instVar2 type -- comment about the purpose of instVar2 Any further useful comments about the general approach of this implementation.
ProtoObjectObjectTObjectTFrameTPrimitiveTPrimitiveMesh
| myCube | myMesh |
| instance | class |
|---|---|
| accessing initialize render | no messages
|
| myCube |
|---|
| myMesh |
|---|
| accessing |
|---|
| initBounds |
| box | myMesh ifNil:[boundSphere _ nil. ^self]. box _ myMesh boundingBox. boundSphere _ TBoundSphere localPosition: (box origin + box corner) * 0.5 radius: (box corner - box origin) length * 0.5. boundSphere frame: self. |
| mesh |
^myMesh |
| mesh: aMesh |
myMesh _ aMesh. self boundsChanged. |
| myCube |
^myCube |
| initialize |
|---|
| initialize |
super initialize. myCube := TCube new. myCube visible: false. myCube objectOwner: self. self addChild: myCube. ^self |
| render |
|---|
| boundsChanged |
| box | super boundsChanged. myMesh ifNotNil:[ box := myMesh boundingBox. myCube translation: box origin + box corner * 0.5. myCube extent: box extent. myCube update. ]. |
| pick: pointer |
^myCube pick: pointer |
| renderPrimitive: ogl |
myMesh ifNotNil:[myMesh renderOn: ogl]. |