Пример #1
0
    void Camera::SetLocation(const Vector3& Location)
    {
        this->Cam->setPosition(Location.GetOgreVector3());
        LocalTransformDirty = !(GetUpdating(Parent));

        _RecalculateLocalTransform();
    }
Пример #2
0
 void WorldObject::SetLocation(const Vector3& Location)
 {
     //Bullet
     this->PhysicsObject->getWorldTransform().setOrigin(Location.GetBulletVector3());
     this->PhysicsObject->getInterpolationWorldTransform().setOrigin(Location.GetBulletVector3());
     //Ogre
     this->GraphicsNode->setPosition(Location.GetOgreVector3());
 }
Пример #3
0
        void Line3D::DrawLines()
        {
            // Drawing stuff
            Whole NumPoints = this->Points.size();
            if( NumPoints > 0 )
            {
                if( mRenderOp.vertexData->vertexCount < NumPoints )
                {
                    Whole NewVertexBufferSize = 1;
                    while(NewVertexBufferSize < NumPoints)
                        NewVertexBufferSize <<= 1;

                    this->VertexBuffer = Ogre::HardwareBufferManager::getSingleton().createVertexBuffer(
                        mRenderOp.vertexData->vertexDeclaration->getVertexSize(0),
                        NewVertexBufferSize,
                        Ogre::HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE,
                        false);

                    mRenderOp.vertexData->vertexBufferBinding->setBinding(0,this->VertexBuffer);
                    mRenderOp.vertexData->vertexCount = NewVertexBufferSize;
                    mRenderOp.vertexData->vertexStart = 0;
                }

                Vector3 vaabMin = this->Points[0].Position;
                Vector3 vaabMax = this->Points[0].Position;

                Real* prPos = static_cast<Real*>(this->VertexBuffer->lock(Ogre::HardwareBuffer::HBL_DISCARD));
                for( Whole Index = 0 ; Index < NumPoints ; ++Index )
                {
                    const LineVertex& CurrVertex = this->Points.at(Index);

                    // Position assignment
                    *prPos++ = CurrVertex.Position.X;
                    *prPos++ = CurrVertex.Position.Y;
                    *prPos++ = CurrVertex.Position.Z;

                    // Colour assignment
                    *prPos++ = CurrVertex.Colour.R;
                    *prPos++ = CurrVertex.Colour.G;
                    *prPos++ = CurrVertex.Colour.B;
                    *prPos++ = CurrVertex.Colour.A;

                    // Bounds checking
                    if(CurrVertex.Position.X < vaabMin.X)
                        vaabMin.X = CurrVertex.Position.X;
                    if(CurrVertex.Position.Y < vaabMin.Y)
                        vaabMin.Y = CurrVertex.Position.Y;
                    if(CurrVertex.Position.Z < vaabMin.Z)
                        vaabMin.Z = CurrVertex.Position.Z;

                    if(CurrVertex.Position.X > vaabMax.X)
                        vaabMax.X = CurrVertex.Position.X;
                    if(CurrVertex.Position.Y > vaabMax.Y)
                        vaabMax.Y = CurrVertex.Position.Y;
                    if(CurrVertex.Position.Z > vaabMax.Z)
                        vaabMax.Z = CurrVertex.Position.Z;
                }
                this->VertexBuffer->unlock();

                mBox.setExtents(vaabMin.GetOgreVector3(), vaabMax.GetOgreVector3());
            }
        }
Пример #4
0
 void Camera::SetFixedYawAxis(bool UseFixed, const Vector3& Axis)
 {
     this->Cam->setFixedYawAxis(UseFixed, Axis.GetOgreVector3());
     this->YawAxis = Axis;
     this->YawOnAxis = UseFixed;
 }
Пример #5
0
 void Camera::MoveRelative(const Vector3& ToMove)
 {
     this->Cam->moveRelative(ToMove.GetOgreVector3());
 }
Пример #6
0
 void Camera::LookAt(const Vector3& TargetLoc)
 {
     this->Cam->lookAt(TargetLoc.GetOgreVector3());
 }
Пример #7
0
 void Camera::SetDirection(const Vector3& Direction)
 {
     this->Cam->setDirection(Direction.GetOgreVector3());
 }
Пример #8
0
 void WorldObject::SetScaling(const Vector3& Scale)
 {
     this->GraphicsNode->setScale(Scale.GetOgreVector3());
     this->PhysicsShape->setLocalScaling(Scale.GetBulletVector3());
 }