Tag Info

Hot answers tagged

5

For 3D, Unity uses PhysX. According to this answer, PhysX uses a symplectic integrator. The paper it cites as evidence is a bit more ambiguous though: Since it is a commercial engine the implementation details are unknown ... Most physics engines provide results similar to the Symplectic Euler integrator, or 2nd order Euler. Novodex (Ageia PhysX) ...


4

What you have here are two constraints that need to be resolved. On one hand, you need the sphere to stay outside the wall, by pushing it along the normal. On the other hand, you have the constraint that the sphere needs to stay attached to the ground. If you don't want to try writing fancy solvers, the easiest way to do this is to use an iterative solver. ...


4

Any easy way to do this is to form your cloth to approximate the surface as many small spheres. This will work if you have a fairly good particle size to edge-length ratio. To avoid a silly N^2 collision detection algorithm you can use a simple implementation of spacial hashing. First lets talk about spatial hashing for a discrete point. You take it's ...


3

Inverse kinematics. That is the word I think you are looking for (easily googlable). As for libraries, I do not think so. It is very rare technique - the only game I can think of using inverse kinematics is Kingdom Come: Deliverance.


2

getBoundsInParent() returns the bounding box around the shape — a rectangle. The built-in intersects() check works only for rectangular shapes, not for circles, polygons, etc. For these, you'd need to implement the check yourself.


2

I don't know the specifics of GameMaker, but this is how I achieved this effect in Unity. First I defined a Boundary class that defines the limits of the play area. This class includes a method trimToBoundary that takes an arbitrary coordinates and clamps them to the boundary space, like this Mathf.Clamp (x, xMin, xMax), Mathf.Clamp (y, yMin, yMax), Then ...


1

I've been puzzling with this in the creation of my physics based game. I've decided to settle with creating my animations used a skeletal key-frame based animations system (Similar to flash if you've used it). I will then create physics bodies for each 'limb' of my character. Each of these limbs will have forces applied (depending on the distance from the ...


1

Your car is slipping for the same reason that a car hanging up-side down, riding the ceiling, with 100% friction would slip. 100% friction roughly means that 100% of the force exerted via the wheels on the terrain is used to counter movement perpendicular along the normal of the terrain. But this force still isn't enough to counter the force of gravity. This ...


1

You add a constant force by doing pretty much what you're doing already. The problem you're likely having is a debugging one, or your expecting more force to be added then you're actually adding. Keep in mind that if you want the force to affect the object, you'll probably want to apply a larger force when the touch has ended. Remember that how much the ...


1

Mmmm, interesting question. The first approximation could be the following: simply divide your character into a set of physical bodies. I mean, you could calculate resultant force on legs, feet, arms and hands and operate with the results. Think in Rayman, for example. It can be a good model to start with. The character would be formed by head, body, hands ...


1

Typically a physics engine will follow these steps: Broad-phase collision detection. Typically using bounding volumes, this reduces the set of all objects to a small subset of potentially colliding objects. Some data structures to handle broad-phase are AABB trees, KD-trees, Octrees, etc. Narrow-phase collision detection. From the subset of potential ...


1

Finally, I found the geometric solution! I will share the code in JavaScript with three.js which is a 3d library, provides math stuff to JavaScript. var face = contactInfo.face, normal = contactInfo.normal, distance = contactInfo.distance, point1 = new THREE.Vector3(), point2 = new THREE.Vector3(), direction = new ...


1

In case you're looking for a pure geometric solution and not a physics one, i.e. you're not using gravity so that the ball falls down basically on an inclined plane, then I suggest you look at it as finding the position of the center after the collision so that the ball is tangent to both the wall and the ground. Unfortunately I cannot make a fancy drawing, ...


1

Why calculate the trajectory for the sounds/slow down effects? If you split the act of slowing down the camera and playing effects into sections upon approach to your squishy victim then you can essentially play them on condition of their proximity. This is a great example that comes to mind. The proximity slow down effects employed in Peggle The ball ...


1

There's nothing built in that'll allow you to view gizmos in a released game. However, you can create your own debugging viewer by using the LineRenderer. Personally I would create something like a DrawBounds method that accepts the Bounds property of the collider.


1

If you have sleeping allowed (and the b2_timeToSleep is sufficiently short for your needs) you can use the b2Body::isAwake function to test if a rock is settled. Pseudo-code: For body in bodies: If(body is rock and not body->isAwake()) Then //Apply impulse End If End loop



Only top voted, non community-wiki answers of a minimum length are eligible