![]() Kinetic bodies (which already exist in box2d) are meant to solve this problem. The example you posted is interested but as far as I understand it it is a hack around the problem. An immovable object will not respond to any sort of force. You can either apply a force or set its position or set the velocity. As far as I am aware, there is no other way to move a physics object. This breaks the physics system as you are basically teleporting the object around and it has no energy to impart when it collides with another object. If it slams into another object at high speed the object will move just enough to resolve collision.Įli0s behaviors (such as rotate, or sin) move things via position setting. If you just move it around without using forces it won't behave correctly. The moving platform is another problem though because it needs to be able to be moved in a way that makes it have force. The spinner stays in place and imparts a force/impulse on objects it hits. The spinning platform can be solved by using a static body and having a dynamic body anchored to it via a revolute joint. ![]() ![]() If you set a physics object as immovable and then use events to cause it to rotate in place when it strikes another physics object set as dynamic that object will only resolve collision but it won't fly off as though it was hit. If you change its position to move it then the object will not function as expected in the box2d physics model. If you control a set 'Immovable' object by events to move it, wouldn't that do the exact thing you want?Īphrodite - It won't work, simply because the only way you can "move" a physics object is by use of a force or impulse. Is this perhaps the same with kinematic bodies? Is the code for this body type already in construct, it just doesn't have editor support?Īnd while i'm on the topic of box 2d, is it possible to have chain shapes in construct? Wherever there are internal edges, dynamic bodies trip up on them, chains would solve this! or even ghost vertices. Having collision masks would be super helpful). Check out the link below for a short sequence of code demonstrating its uses and a short explanation.Īshley Is there a way to bring this functionality of box2d into construct ? I know there was limitations in the box2d version optimized for javascript /html5 (you can't disable collisions- Why is this btw?. Not every object that moves needs to be moved by other objects. Ever wanted to have a moving platform using physics but gave up because every time the player jumps on it it gets thrown off course? A kinematic body would work well here, but all that you can have in construct 2 is dynamic or static. In other words, it can move but cannot be moved by other objects. This is a hybrid body that can have a linear velocity but that is unaffected by forces acting on it. There is a third type of body available in box2d that I need and perhaps you do to: The kinematic body. Within this realm we can either chose to have a body that is dynamic (reacts to collisions) or static (doesn't move). In construct 2 we have access to box 2d physics.
0 Comments
Leave a Reply. |