bool PUGeometryRotatorTranslator::translateChildObject( PUScriptCompiler* compiler, PUAbstractNode *node ) { PUObjectAbstractNode* child = reinterpret_cast<PUObjectAbstractNode*>(node); PUAffector* af = static_cast<PUAffector*>(child->parent->context); PUGeometryRotator* affector = static_cast<PUGeometryRotator*>(af); PUDynamicAttributeTranslator dynamicAttributeTranslator; if (child->cls == token[TOKEN_ROTATION_SPEED]) { // Property: rotation_speed dynamicAttributeTranslator.translate(compiler, node); PUDynamicAttribute* dynamicAttribute = static_cast<PUDynamicAttribute*>(child->context); affector->setRotationSpeed(dynamicAttribute); return true; } else if (child->cls == token[TOKEN_GEOMROT_ROTATION_SPEED]) { // Property: geom_rot_rotation_speed (deprecated and replaced by 'rotation_speed') dynamicAttributeTranslator.translate(compiler, node); PUDynamicAttribute* dynamicAttribute = static_cast<PUDynamicAttribute*>(child->context); affector->setRotationSpeed(dynamicAttribute); return true; } return false; }
bool PUJetAffectorTranslator::translateChildObject( PUScriptCompiler* compiler, PUAbstractNode *node ) { PUObjectAbstractNode* child = reinterpret_cast<PUObjectAbstractNode*>(node); PUAffector* af = static_cast<PUAffector*>(child->parent->context); PUJetAffector* affector = static_cast<PUJetAffector*>(af); PUDynamicAttributeTranslator dynamicAttributeTranslator; if (child->cls == token[TOKEN_ACCELERATION]) { // Property: acceleration dynamicAttributeTranslator.translate(compiler, node); PUDynamicAttribute* dynamicAttribute = static_cast<PUDynamicAttribute*>(child->context); affector->setDynAcceleration(dynamicAttribute); return true; } else if (child->cls == token[TOKEN_JET_ACCELERATION]) { // Property: jet_aff_accel (deprecated and replaced by 'acceleration') dynamicAttributeTranslator.translate(compiler, node); PUDynamicAttribute* dynamicAttribute = static_cast<PUDynamicAttribute*>(child->context); affector->setDynAcceleration(dynamicAttribute); return true; } return false; }
bool PUScaleAffectorTranslator::translateChildObject( PUScriptCompiler* compiler, PUAbstractNode *node ) { PUObjectAbstractNode* child = reinterpret_cast<PUObjectAbstractNode*>(node); PUAffector* af = static_cast<PUAffector*>(child->parent->context); PUScaleAffector* affector = static_cast<PUScaleAffector*>(af); PUDynamicAttributeTranslator dynamicAttributeTranslator; if (child->cls == token[TOKEN_SCALE_XYZ_SCALE]) { // Property: xyz_scale dynamicAttributeTranslator.translate(compiler, node); PUDynamicAttribute* dynamicAttribute = static_cast<PUDynamicAttribute*>(child->context); affector->setDynScaleXYZ(dynamicAttribute); return true; } else if (child->cls == token[TOKEN_SCALE_X_SCALE]) { // Property: x_scale dynamicAttributeTranslator.translate(compiler, node); PUDynamicAttribute* dynamicAttribute = static_cast<PUDynamicAttribute*>(child->context); affector->setDynScaleX(dynamicAttribute); return true; } else if (child->cls == token[TOKEN_SCALE_Y_SCALE]) { // Property: y_scale dynamicAttributeTranslator.translate(compiler, node); PUDynamicAttribute* dynamicAttribute = static_cast<PUDynamicAttribute*>(child->context); affector->setDynScaleY(dynamicAttribute); return true; } else if (child->cls == token[TOKEN_SCALE_Z_SCALE]) { // Property: z_scale dynamicAttributeTranslator.translate(compiler, node); PUDynamicAttribute* dynamicAttribute = static_cast<PUDynamicAttribute*>(child->context); affector->setDynScaleZ(dynamicAttribute); return true; } return false; }