void CCTile3DButton::setupBase(const float width, const float height) { if( baseSquare == NULL ) { baseSquare = new CCPrimitiveSquare(); baseModel->addPrimitive( baseSquare ); } const float hWidth = width * 0.5f; const float hHeight = height * 0.5f; setHCollisionBounds( hWidth, hHeight, CC_SMALLFLOAT ); baseSquare->setupZFacing( collisionBounds.x, collisionBounds.y ); CCUpdateCollisions( this ); }
CCSceneCollideable::CCSceneCollideable() { octreeRender = true; collideableType = 0; setHCollisionBounds( 0.5f, 0.5f, 0.5f ); updateCollisions = true; octrees.allocate( 32 ); drawOrder = 100; visible = false; owner = NULL; }
CCTile3DButton::CCTile3DButton(CCSceneBase *scene, const char *text, const float height, const bool centered) { construct( scene ); textModel->setText( text, height ); const float width = textModel->getWidth(); setHCollisionBounds( width * 0.5f, height * 0.5f, CC_SMALLFLOAT ); textModel->setCentered( centered ); if( centered == false ) { translate( collisionBounds.x, 0.0f, 0.0f ); } }
void CCSceneCollideable::setHSquareCollisionBounds(const float hWidth, const float hHeight) { setHCollisionBounds( hWidth, hHeight, hWidth ); }
void CCSceneCollideable::setHSquareCollisionBounds(const float hSize) { setHCollisionBounds( hSize, hSize, hSize ); }