Jump to content

Animation freezes when camera is close.


AggrorJorn
 Share

Recommended Posts

I have this animation in the editor which seems to be working fine. However when you fly close towards it, the animation freezes. When I fly away with the camera the animation continues. This also happens when I run the fpscontroller.lua.

 

Anybody have an idea why this is? This is the lua file:

require("scripts/class")

local class=CreateClass(...)


function class:CreateObject(model)
local object=self.super:CreateObject(model)



function object:Render()
	frame = (AppTime()/32.0) % (60-0) + 1
	model:Animate( frame, 1,0, 1 )		
end

function object:Free(model)
	self.super:Free()
end

end

Link to comment
Share on other sites

Because the model AABB doesn't encompass the whole object, so the render function gets skipped when you are close.

 

BTW, using the Render function like this will result in an enormous speed increase, because you can have tons of offscreen characters that don't have to be animated.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

No, the model bounding box has nothing to do with the collision type.

 

Add some dummy vertices to make the mesh larger so it will make a bounding box big enough to contain all the mesh when animated.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...