TPrimitiveMesh


Croquet-Teapot

Comment:

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.

Hierarchy:

ProtoObject
Object
TObject
TFrame
TPrimitive
TPrimitiveMesh

Summary:

instance variables:

myCube myMesh

methods:

instance class
accessing initialize render no messages

Detail:

instance variables:

myCube
myMesh

instance methods:

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].

class methods:

^top


- made by Dandelion -