Closed GoogleCodeExporter closed 9 years ago
[deleted comment]
It seems like that function would have a specific and limited application. Why
not just schedule this in PreSolve for after the physics time step and use
something like contact->GetFixtureA()->GetBody()->SetLinearVelocity() with
direction based on the tangent of oldManifold->localNormal and the speed based
on how fast you want the conveyor to be?
Original comment by rocif...@gmail.com
on 29 Aug 2011 at 3:48
Yeah, it does seem quite specific and I don't see many people clamoring to have
it implemented, which I guess is why it hasn't been added. I have it on my
todo-list to make a demo with source code showing how I approached this, it
will be interesting to see how much attention it gets. That's probably a few
more weeks away, in the meantime you can see how it looks in practice:
http://www.youtube.com/watch?v=yGU1E6wQFqE
I believe the SetLinearVelocity() method only works when used on static bodies,
so it doesn't handle dynamic/dynamic contacts. Other issues are that it would
affect all other bodies touching the static body as opposed to having each pair
of bodies controllable individually, and you'd need to keep track of when to
set the velocity back to normal somehow.
Original comment by iforc...@gmail.com
on 30 Aug 2011 at 8:21
Ah cool video, I actually found this the other day, and was impressed. I am
looking at creating some kind of water elevator for our game. Here's a video of
the water simulation I've implemented http://www.youtube.com/watch?v=NxosUZCF-bE
Do you think some kind of fully simulated tracks for an escalator would work,
or would you use the method you've done and fake any motion by rendering
animated sprites? The box2d json project had a great looking tank that had
fully simulated tracks, but I think your solution is more elogant and robust
for a game environment.
Original comment by rocif...@gmail.com
on 30 Aug 2011 at 8:36
It looks like you will need fully simulated buckets or something to carry those
particles. The only way they would be make it up a fake-surface-velocity slope
is if they were square enough not to roll down :)
Original comment by chriszca...@gmail.com
on 30 Aug 2011 at 10:10
http://www.iforce2d.net/b2dtut/conveyor-belts
Original comment by iforc...@gmail.com
on 27 Oct 2011 at 8:20
Command: Commit
Modified: D:\Development\Box2D\Box2D\Box2D\Collision\b2BroadPhase.cpp
Modified: D:\Development\Box2D\Box2D\Box2D\Common\b2Settings.cpp
Modified: D:\Development\Box2D\Box2D\Box2D\Dynamics\Contacts\b2Contact.cpp
Modified: D:\Development\Box2D\Box2D\Box2D\Dynamics\Contacts\b2Contact.h
Modified:
D:\Development\Box2D\Box2D\Box2D\Dynamics\Contacts\b2ContactSolver.cpp
Modified: D:\Development\Box2D\Box2D\Box2D\Dynamics\Contacts\b2ContactSolver.h
Modified: D:\Development\Box2D\Box2D\Box2D\Dynamics\Joints\b2PulleyJoint.cpp
Modified: D:\Development\Box2D\Box2D\Box2D\Dynamics\Joints\b2PulleyJoint.h
Modified: D:\Development\Box2D\Box2D\Build\vs2010\Testbed.vcxproj
Modified: D:\Development\Box2D\Box2D\Build\vs2010\Testbed.vcxproj.filters
Modified: D:\Development\Box2D\Box2D\CMakeLists.txt
Modified: D:\Development\Box2D\Box2D\Documentation\manual.docx
Adding: D:\Development\Box2D\Box2D\Testbed\Tests\ConveyorBelt.h
Modified: D:\Development\Box2D\Box2D\Testbed\Tests\Gears.h
Modified: D:\Development\Box2D\Box2D\Testbed\Tests\Pulleys.h
Modified: D:\Development\Box2D\Box2D\Testbed\Tests\TestEntries.cpp
Sending content: D:\Development\Box2D\Box2D\Testbed\Tests\Pulleys.h
Sending content: D:\Development\Box2D\Box2D\Documentation\manual.docx
Sending content: D:\Development\Box2D\Box2D\Testbed\Tests\Gears.h
Sending content:
D:\Development\Box2D\Box2D\Box2D\Dynamics\Joints\b2PulleyJoint.h
Sending content:
D:\Development\Box2D\Box2D\Build\vs2010\Testbed.vcxproj.filters
Sending content: D:\Development\Box2D\Box2D\Testbed\Tests\TestEntries.cpp
Sending content: D:\Development\Box2D\Box2D\Box2D\Collision\b2BroadPhase.cpp
Sending content: D:\Development\Box2D\Box2D\Testbed\Tests\ConveyorBelt.h
Sending content:
D:\Development\Box2D\Box2D\Box2D\Dynamics\Contacts\b2ContactSolver.cpp
Sending content:
D:\Development\Box2D\Box2D\Box2D\Dynamics\Contacts\b2ContactSolver.h
Sending content:
D:\Development\Box2D\Box2D\Box2D\Dynamics\Contacts\b2Contact.cpp
Sending content: D:\Development\Box2D\Box2D\Box2D\Dynamics\Contacts\b2Contact.h
Sending content: D:\Development\Box2D\Box2D\Box2D\Common\b2Settings.cpp
Sending content: D:\Development\Box2D\Box2D\CMakeLists.txt
Sending content: D:\Development\Box2D\Box2D\Build\vs2010\Testbed.vcxproj
Sending content:
D:\Development\Box2D\Box2D\Box2D\Dynamics\Joints\b2PulleyJoint.cpp
Completed: At revision: 238
Original comment by erinca...@gmail.com
on 14 Nov 2011 at 5:46
Original issue reported on code.google.com by
iforc...@gmail.com
on 5 Jul 2011 at 6:29