Esempio n. 1
0
Matrix3x4 SceneNode::getWorldTransform()
{
	if (dirty_)
		updateWorldTransform();

	return worldTransform_;
}
Esempio n. 2
0
void View::setSize(float width, float height) {
	if (mWidth != width || mHeight != height) {
		mWidth = width;
		mHeight = height;
		setSize(width, height);
		updateWorldTransform();
	}
}
Esempio n. 3
0
Transform GfxBody::getBoneWorldTransform (unsigned n)
{
    checkBone(n);
    Ogre::Bone *bone = skeleton->getBone(n);
    Transform t(from_ogre(bone->_getDerivedPosition()), from_ogre(bone->_getDerivedOrientation()), from_ogre(bone->_getDerivedScale()));
    updateWorldTransform();
    return worldTransform * t;
}
Esempio n. 4
0
//==============================================================================
Bool MoveComponent::update(SceneNode&, F32, F32, UpdateType uptype)
{
	if(uptype == ASYNC_UPDATE && getParent() == nullptr)
	{
		// Call this only on roots
		updateWorldTransform();
	}

	// move component does it's own updates
	return false;
}
Esempio n. 5
0
const Transform3 Node::worldTransform() const
{
    if (worldTransformValid_ == false)
    {
        updateWorldTransform();

        // updateWorldTransform() should validate the world transform
        GRAPHICS_RUNTIME_ASSERT(worldTransformValid_ == true);
    }

    return worldTransform_;
}
Esempio n. 6
0
void View::setPosition(float x, float y) {
	mX = x;
	mY = y;
	SE_Matrix3f identity3;
	identity3.identity();

	SE_Matrix4f transform;
	transform.identity();

	transform.set(identity3,SE_Vector3f(mX,mY,0));

	setPrevMatrix(transform);

	//update
	updateWorldTransform();
	updateBoundingVolume();
}
Esempio n. 7
0
ViewGroup::ViewGroup(SE_Spatial* parent):SE_CommonNode(parent)
{
	setNodeType(GROUP_NODE);

	SE_SpatialID spatialID = SE_ID::createSpatialID();
	unsigned int* ids = spatialID.getID();
	SE_SimObjectID id(ids[0], ids[1], ids[2], ids[3]);

/*
    SE_Geometry* geometry = new SE_Geometry(spatialID, root);
    geometry->attachSimObject(this);
	SE_Application::getInstance()->getSimObjectManager()->set(spatialID, this);*/
    updateWorldTransform();
    updateBoundingVolume();

	parent->addChild(this);

}
Esempio n. 8
0
void GfxBody::updateBoneMatrixes (void)
{
    if (skeleton) {

        //update the current hardware animation state
        skeleton->setAnimationState(animationState);
        skeleton->_getBoneMatrices(boneMatrixes);

        updateWorldTransform();

        Ogre::Matrix4 world = node->_getFullTransform();

        Ogre::OptimisedUtil::getImplementation()->concatenateAffineMatrices(
            world,
            boneMatrixes,
            boneWorldMatrixes,
            numBoneMatrixes);
    }
}
Esempio n. 9
0
bool DHSkeleton::init() {
    if (!m_data || !Node::init()) {
        return false;
    }
    
    m_bones = m_data->newBones();
    
    m_slots = m_data->newSlots(this);
    
    m_drawOrder = new DHSlot*[m_data->getSlotCount()];
    memcpy(m_drawOrder, m_slots, sizeof(DHSlot*) * m_data->getSlotCount());
    
    m_ikConstraints = m_data->newIkConstraints(this);
    
    updateCache();
    
    updateWorldTransform();
    
    setGLProgram(GLProgramCache::getInstance()->getGLProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP));
    
    return true;
}
Esempio n. 10
0
//==============================================================================
Error MoveComponent::update(SceneNode& node, F32, F32, Bool& updated)
{
	updated = updateWorldTransform(node);
	return ErrorCode::NONE;
}