yomotsu / meshwalk

for your TPS game development with three.js.
240 stars 42 forks source link

How to update octree? #7

Open notchris opened 5 years ago

notchris commented 5 years ago

I can see how to remove an object from the octree, but how would I go about animating a block that moves up and down? I'm able to continuously add / remove the object from the octree, updating its calculated collider position, but this bogs down the render. Is this possible? Thanks!

notchris commented 5 years ago

I was able to build a workaround, but would love some input on this issue.

yomotsu commented 5 years ago

sorry for very late replay🙇‍♂️

So far, there is no feature for moving object. maybe, make an empty octree instance and put one moving object, then add / remove at every movement. This could be a workaround. However, the velocity of moving object will not affect the player.

notchris commented 5 years ago

Ah that is an interesting idea @yomotsu. I'm going to try that later. Would love to help with testing / improvements.