Example #1
0
void Node::draw( 
const Matrix44& pvm,
const Matrix34& parentWm,
const Vector3& lightVector,
const Vector3& lightColor,
const Vector3& ambient ) const {
	Matrix34 wm;
	wm.setTranslation( mTranslation );
	wm.rotateY( mRotation.y );
	wm.rotateX( mRotation.x );
	wm.rotateZ( mRotation.z );
	wm.scale( mScale );

	wm.setMul( parentWm, wm );

	if ( mBatch ){
		mBatch->draw( 
			pvm,
			wm,
			lightVector,
			lightColor,
			ambient,
			mColor );
	}
	//子へ受け継ぐ
	for ( int i = 0; i < mChildNumber; ++i ){
		ASSERT( mChildren[ i ] ); //0が入ってたら異常。
		mChildren[ i ]->draw(
			pvm,
			wm,
			lightVector,
			lightColor,
			ambient );
	}
}
Example #2
0
void Model::draw() const {
	Matrix34 wm;
	wm.setTranslation( mPosition );
	wm.rotateY( mAngle.y );
	wm.rotateX( mAngle.x );
	wm.rotateZ( mAngle.z );
	wm.scale( mScale );

	GameLib::Graphics::Manager::instance().setWorldMatrix( wm );
	mBatch->draw();
}
Example #3
0
void Model::draw( const Matrix44& pvm ) const {
	Matrix34 wm;
	wm.setTranslation( mPosition );
	wm.rotateY( mAngle.y );
	wm.rotateX( mAngle.x );
	wm.rotateZ( mAngle.z );
	wm.scale( mScale );

	Matrix44 transform;
	transform.setMul( pvm, wm );

	mBatch->draw( transform );
}
Example #4
0
void Tree::draw(
const Matrix44& pvm,
const Vector3& lightVector,
const Vector3& lightColor,
const Vector3& ambient ) const {
	Matrix34 wm;
	wm.setTranslation( mPosition );
	wm.rotateY( mAngle.y );
	wm.rotateX( mAngle.x );
	wm.rotateZ( mAngle.z );
	wm.scale( mScale );

	//根ノードへ渡す
	if ( mNodes ){
		mNodes[ 0 ].draw(
			pvm,
			wm,
			lightVector,
			lightColor,
			ambient );
	}
}