Tag Info

New answers tagged

2

Part 1: Interpolation: Interpolation let's us approximate something that already happened. Multiplying "trick" (which is just math) is to mix the previous state with the current state by a certain percentage. If previous was dark and now is bright, we assume in the middle it was grey. So if for example we take a moving train. We know that right now it is ...


0

The bounding box automatically move with the sprite. If you don't believe it, use the ShapeRenderer to draw your sprite's bounding box each frame and check if it actually follow it or not.


1

I wonder if chopmunk allows the object to be made static inside a callback issued from the guts of the physics engine. What if you set a flag on the object and after updating physics you set things static? It would be worth checking the documentation on cpSpaceRemoveBody. I looked into the source code for chipmunk, and here's the relevant function: void ...


0

Give the ball some restitution (box2d property) having a rigid circle body attached, and later, simply apply some force to it ;) It will work as shown (of course, u should be having some bounding box) Could give you currect code if u needed :) code: Body ball; BodyDef _b = new BodyDef(); _b.position.set(new Vector2(0, 0)); //your wish _b.type = ...


-1

This seems like a standard engineering problem. It is definitely possible to determine the rotations of all gears, even with multiple drivers. Read up on Gear Trains. If this is a big part of your work, it might be worth picking up a book on engineering dynamics. Good luck!


0

tl;dr code example with md5 (you can run it here): function getHashTail($pair) { $res = hexdec(substr(md5($pair), -4)) % 1024; return $res < 100? dechex($res % 16) : ' '; } Usage example: <html> <head> <title>Hash space</title> <style> div { text-align:center; vertical-align:top; ...


0

What you're describing is procedural generation (of some kind of universe in this example). This is actually rather trivial to do. Basically you'll just have to calculate everything on basis of your coordinates. This can either be done by simple math or by using the coordinates as the seed for your random number generator. In your example, you want 20 % of ...


2

While I can't speak for Erin Catto himself, the simple answer is that in many games-related physics systems a standard Euler method is preferred to a Runge-Kutta method because it is less expensive computationally, while also being sufficiently stable for games in general. If RK4 was used the integrator would become a larger bottleneck, impacting the ...


5

It's very probable that Erin Cato subtly justified the use of the Symplectic Euler over RK4 or another higher order integrator. The author has lots of slides and/or material (e.g. http://gamedevs.org/uploads/numerical-integration.pdf) related to the inner workings of the Box2D engine. The main reasons for why RK4 is not really needed when writing this kind ...


1

First of all, if you want to avoid aliasing problems, you need to respect the Shannon rule. So you need to take 120FPS or more. Secondly, you don't really need to care, you can simulate at 40 if you want, just be sure to linearly interpolate all of your matrices, the frame presentation time is the t, and your physics simulation always have to run some ...


0

Instead, get the direction from the origin to the target. Instead of moving the projective towards a destination, move it in a direction. Something like: // Determine the direction Vector2 direction = (origin - direction).normalized; Then something like: void FixedUpdate() { if (CanMove) { transform.position = transform.position + ...



Top 50 recent answers are included