Tag Info

Hot answers tagged

6

Basically, you'll need to create a physics engine. A rope is conceptually a bunch of "nodes" connected together with springs. Basically, every tick, each nodes will exert a force on the nodes above and below it proportional to their distance apart (or how far from their comfortable stretch length they are). If you want to attach a ball, just connect it ...


4

I'm using Hooke's Law here as the definition of a spring. () Given the derivatives of position and velocity, are velocity and force respectively, we can construct a differential equation for the stretching of the spring. Which is just a damped harmonic oscillator, and since we already know that only the under-damped case need analysis, we can obtain a ...


3

Each rigid body has an attribute indicating if it's affected by gravity or not. You can just mark that attribute as true, whenever player enters the spaceship, and later turn it false, when he exits. But that'll limit you with a big limitation. The gravity itself in unity is something global, meaning all entities are affected by same gravity force (if any). ...


2

I spent a good while looking how to implement Box2D in Android studio, so for anyone else in the same boat, or just looking to implement Box2D - here goes. For implementing Box2D into your java code/framework, Box2D is tuned to work with numbers between 0.1 and 10 (it works in meters), quoting from the Box2D manual: http://box2d.org/manual.pdf Box2D ...


2

That side force is the horizontal component of the road's normal with respect to the car's forward movement. Roads are banked like you are discussing to facilitate cornering at higher speeds without flying off the track from momentum pushing them to the outside corner. The banking pushes back in a direction the tires do not freely rotate and can hopefully ...


2

When the user presses the "orbit" button, store the vector between the ship and the planet. On every update, change the vector's angle leaving magnitude the same and then update the ships position by adding the planets position and the vector pointing at the ships new position. This will create the effect of the ship moving in a uniform circle around the ...


1

The answer is a YES, You may set the gravity vector to (0,-some number) for this purpose, your code which multiplies the g scalar with sin and cos of 45 degree will be true if the SpriteKit physics coordinate system could be changes to your isometric coordinate system, I mean the direction of the gravity vector is still the Y axis, look at your Z axis ( ...


1

Assuming A at position 0,0 free fall equations (with starting velocity on x (Vx) , and g=gravity constant ) are: (1) x=Vx * t (2) y= (1/2)*g * t^2 substitute t in second eq. you get (3) y= (1/2) * g * (x/Vx)^2 where g and Vx are known. This is a parabola equation : Intersect (3) with each wall segment to get the eventualy collisions point ...


1

The rope in your example is probably just a simple physics-joint that limits the distance of the ball to the mouse-cursor. These joints are typically called "Rope joint" or "Spring joint". It seems like the ripples in the string are not based on an actual physics-simulation. Most likely this is a bezier-curve where the control points get further pushed away ...


1

From here, this can be used to calculate the volume of an arbitrary 3D mesh. public float SignedVolumeOfTriangle(Vector3 p1, Vector3 p2, Vector3 p3) { float v321 = p3.x * p2.y * p1.z; float v231 = p2.x * p3.y * p1.z; float v312 = p3.x * p1.y * p2.z; float v132 = p1.x * p3.y * p2.z; float v213 = p2.x * p1.y * p3.z; float v123 = ...


1

i did something similar a while back, it's not that hard, one very easy and understandable way is : 1- rotate everything! means every line every object, so everything is simply flat! 2- calculate velocity, gravity, friction and ... anything you like ! just the way you always do in a flat and without rotation world 3- rotate everything back the way it was ! ...


1

I was playing around a little and rereading the manual again. It noted that the size of the actual box is 2x the given size. Half-widths. So I continued to play around inside my graphics system and continued to see where the box was colliding and not and ended up with: Negate the (untouched) size from the position. Double the size of the boxes. glm::vec2 ...


1

You need a tensor for a generic solution. but the "specialized" solution here is that you have a a spin only if you have friction in your contact. otherwise of course the contact forces will purely be directed to the center of the circle and never cause spin. if you have friction, your forces will start to deviate within the realms of the friction cone, ...


1

The trajectory of the particles is a Bézier curve. A Bézier curve is a smooth curve along four points: pointA: startpoint pointB: startdirection+acceleration pointC: enddirection+accelleration pointD: endpoint Basically it generates a curve through from point A to point D, using the vectors towards A-B and C-D to determine the path. See C# (Monogame) ...



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