Hi,
Do anyone have a idea what would cause a mesh to disappear? I can’t figure out if it’s the camera or mesh itself. Everything seems normal but as soon as it hits a point it vanishes. I have no zone setup either.
It seems the device is lost, affecting the vertex buffer. I will have details later.
[video]https://youtu.be/Do0pOChpZm4[/video]
Direct Link
youtu.be/Do0pOChpZm4
The code I’m using is
[code]
// If camera exist
if (m_pCamera)
{
// Updaw character yaw and povement
Quaternion Rot(1.0f, 0.0f, 0.0f, 0.0f);
// Get mouse position
IntVector2 MousePosition = m_pInput->GetMousePosition();
// Calculate look based on screen view
float mWindowBasePitched = (float)(MousePosition.x_ - (g_pApp->GetGraphics()->GetWidth() / 2));
float mWindowBaseYaw = (float)(MousePosition.y_ - (g_pApp->GetGraphics()->GetHeight() / 2));
float newPitch = Clamp((float)mWindowBasePitched, -90.0f, 90.0f);
float newYaw = Clamp((float)mWindowBaseYaw, -90.0f, 90.0f);
// If key is hard reseet
if(m_pInput->GetKeyDown(KEY_LALT) || m_pInput->GetKeyDown(KEY_RALT))
{
newPitch = 0;
newYaw = 0;
}
// Create a new quaternion
Quaternion CameraClamped(newYaw, newPitch, 0.0f);
Node * pViewCameraNode = m_pCamera->GetNode();
Quaternion RootRot = pViewCameraNode->GetRotation();
// Rotate Camera
if (m_pInput->GetKeyDown(KEY_LCTRL) || m_pInput->GetKeyDown(KEY_RCTRL))
{
if (pViewCameraNode)
{
// Removed line to figure out better rotation
// Quaternion NewRot = RootRot.Slerp(Rot*CameraClamped, timeStep*.99);
Quaternion NewRot = Rot*CameraClamped;
pViewCameraNode->SetRotation(NewRot);
}
}
}[/code]
Vivienne