TSkyBox


Croquet-Teapot

Comment:

TSkyBox is used to render a slowly rotating sky in the world.

Hierarchy:

ProtoObject
Object
TObject
TFrame
TGroup
TSkyBox

Summary:

instance variables:

dalpha

Pool:

OpenGLConstants

methods:

instance class
initialize stepping testing instance creation

Detail:

instance variables:

dalpha

instance methods:

initialize
initializeWithFileName: fname


	|  txtr mat scale shrink sc dy |
	super initialize.
	sc _ 10.
	scale _128 * sc.
	dy _ 0.
	shrink _ 8 * sc.
	mat _ TMaterial new.
	mat fullBright: true.
	mat ambientColor: #(1.0 1.0 1.0 1.0)asFloatArray.
	mat diffuseColor: #(1.0 1.0 1.0 1.0)asFloatArray.
	mat emissiveColor: #(1.0 1.0 1.0 1.0)asFloatArray.

	txtr _ TTexture
				new initializeWithFileName: 'SkyBox', fname, 'BK.bmp'
				mipmap: false
				shrinkFit: false.
	txtr extent: scale@scale.
	txtr translationX: 0.0 y:dy z: (scale-shrink) negated/2.0.
	txtr material: mat.
	txtr materialAlpha: nil.
	self addChild: txtr.

	txtr _ TTexture
				new initializeWithFileName: 'SkyBox', fname, 'LF.bmp'
				mipmap: false
				shrinkFit: false.
	txtr extent: scale@scale.
	txtr rotationAroundY: 90.
	txtr translationX: (scale-shrink)/2.0 negated y:dy z: 0.0.
	txtr material: mat.
	txtr materialAlpha: nil.
	self addChild: txtr.

	txtr _ TTexture
				new initializeWithFileName: 'SkyBox', fname, 'RT.bmp'
				mipmap: false
				shrinkFit: false.
	txtr extent: scale@scale.
	txtr rotationAroundY: -90.
	txtr translationX: (scale-shrink)/2.0 y:dy z: 0.0.
	txtr material: mat.
	txtr materialAlpha: nil.
	self addChild: txtr.

	txtr _ TTexture
				new initializeWithFileName: 'SkyBox', fname, 'FR.bmp'
				mipmap: false
				shrinkFit: false.
	txtr extent: scale@scale.
	txtr rotationAroundY: 180.
	txtr translationX: 0.0 y:dy z: (scale-shrink)/2.
	txtr material: mat.
	txtr materialAlpha: nil.
	self addChild: txtr.


	txtr _ TTexture
				new initializeWithFileName: 'SkyBox', fname, 'UP.bmp'
				mipmap: false
				shrinkFit: false.
	txtr extent: scale@scale.
	txtr rotationAroundX: 90.
	txtr translationX: 0.0 y: ((scale-shrink)/2) + (dy)z: 0.0.
	txtr material: mat.
	txtr materialAlpha: nil.
	self addChild: txtr.
	self solidTree: false.
	dalpha _ 0.02.
	^self

stepping
step

	"rotation is dalpha units per 20 milliseconds, and we assume start at zero clock time" 
	self rotationAroundY: (Croquet teaTime asFloat/20.0) * dalpha.
wantsSteps


	^  true.

testing
isComponent


	^ true.

class methods:

^top


- made by Dandelion -