void VisualEffectsManager::popUpAnimation(ofPtr<BasicVisual> visual, double startAnimation, double animationTime) { if(!visual) return; ofVec3f startScale(0,0,0); ofVec3f endScale(1,1,1); ofPtr<ScaleVisual> scaleVisual = ofPtr<ScaleVisual>(new ScaleVisual(visual,QUADRATIC, EASE_OUT)); scaleVisual->setParameters(startScale,endScale*1.1,animationTime*0.5); scaleVisual->start(startAnimation); this->addVisualEffect(scaleVisual); scaleVisual = ofPtr<ScaleVisual>(new ScaleVisual(visual, QUADRATIC, EASE_OUT)); scaleVisual->setParameters(endScale*1.1,endScale,animationTime*0.5); scaleVisual->start(startAnimation+animationTime*0.5); this->addVisualEffect(scaleVisual); }
void ColladaConverter::PreparePhysicsObject(struct btRigidBodyInput& input, bool isDynamics, btScalar mass,btCollisionShape* colShape) { btTransform startTransform; startTransform.setIdentity(); btVector3 startScale(1.f,1.f,1.f); //The 'target' points to a graphics element/node, which contains the start (world) transform daeElementRef elem = input.m_instanceRigidBodyRef->getTarget().getElement(); if (elem) { domNodeRef node = *(domNodeRef*)&elem; m_colladadomNodes[m_numObjects] = node; //find transform of the node that this rigidbody maps to startTransform = GetbtTransformFromCOLLADA_DOM( node->getMatrix_array(), node->getRotate_array(), node->getTranslate_array(), m_unitMeterScaling ); unsigned int i; for (i=0;i<node->getScale_array().getCount();i++) { domScaleRef scaleRef = node->getScale_array()[i]; domFloat3 fl3 = scaleRef->getValue(); startScale = btVector3((btScalar)fl3.get(0),(btScalar)fl3.get(1),(btScalar)fl3.get(2)); } btRigidBody* body= createRigidBody(elem->getID(), isDynamics, (float) mass,startTransform,colShape); if (body) { //bodyName is used as identifier for constraints body->setUserPointer((void*)input.m_bodyName); m_rigidBodies[m_numObjects] = body; m_numObjects++; } } }