Tag Info

New answers tagged

2

I think this idea will work: Keep a CPU-side copy of the planet mesh. Having mesh vertices also means you have normal vectors for each point on the planet. Then completely disable gravity for all entities, instead applying a force in exactly opposite direction of a normal vector. Now, based on which point should that normal vector of the planet be ...


1

There is such an equation, but it's not easy to obtain. Because the magnus effect depends on the ball's current velocity, it changes when external forces are applied. You cannot calculate the position of the ball by linearly summing the contributions of different forces. If you were hoping you could simply add a few terms to x(t) = ½ a t² + v t, you're out ...


0

First create a vector. It's angle is equal to ball spin speed (degrees per frame) plus the balls trajectory angle ( looking down from the sky). Set the magnitude to however much you want it to effect the trajectory of the ball. Add this vector to the balls vector, or position if you don't use vectors. Probably a good idea to make the magnitude ...


1

I've just had this same problem, and my step-by-step fix was this: Make a new Object to own the collisions. Mine was called 'RoomBoundary' In that Object, add a 'Create' Event which runs this script: // Excuse repetition and magic numbers - I have a 768x1024 room var NewBoundary = physics_fixture_create(); physics_fixture_set_edge_shape(NewBoundary, ...


1

Most games tend to use the simple Euler method of forward integration (that is, integrate the velocity into the position over time, and integrate the acceleration into velocity). Unfortunately,the Euler method is only suitable for very small timescales and short runs. There are more complex methods which are more accurate over very long time scales. The ...


1

Lets take an example with gravity. In the below function, assume we have class member variables for position and velocity. We need to update them due to the force of gravity every dt seconds. void update( float dt ) { acceleration = G * m / r^2; velocity = velocity + acceleration * dt; position = position + velocity * dt; } As dt gets smaller ...


0

Forumlas here - http://www.kellegous.com/j/2006/02/19/bouncing-ball/ - seem to be working quite well, however if anyone knows an alternative version, please post it.


4

You'll likely be using constant acceleration for these large time spans (which could be zero acceleration). The derivative of constant acceleration with respect to time is 0. That means it doesn't change with respect to time, so it doesn't matter how large your delta time is. This little integration with respect to time provides the equations you need. a ...


1

This post could be helpful. Its gist is, you don't use the character controllers, but make your own using the physics engine. Then you use the normals detected underneath the player to orient them to the surface of the mesh. Here's a nice overview of the technique. There are plenty more resources with web search terms like "unity walk on 3d objects mario ...


1

Assuming you are not going for a full out physics simulator: Your plane needs to have a position, velocity, direction(angle), acceleration and various maximum values. On each game step: velocity += acceleration * dt; velocity = clamp(velocity, 0, max_velocity); acceleration = 0; position += velocity * dt; On (de)acceleration: acceleration = ...


1

The second time you're setting the velocity of the rigidbody you pass in 0 for the y coordinate, so it will never move in the y axis. You should really only be setting the velocity of your rigidbody when you jump (as Unity3D recommends), like so: if (Input.GetKeyDown(KeyCode.Space) && IsGrounded()) { Vector3 jumpVel = rigidbody.velocity + ...


0

You can use Path2d to define the outer edge of your rounded rectangle. This actually creates a Shape. To turn this into something you can use, FlatteningPathIterator can be called to create a list of points that can be used to step along the path. You can use this information to draw your circle as it progresses around your progress bar. Here is a good ...


7

You can use Time.TimeScale for slow motion effect.


0

I would suggest Perlin Noise to do this. Basically, generate N perlin noise values for each different factor, or, if you prefer 1 perlin noise value that gets hashed to a class (like planet, or emptiness): int x, y; // coordinates float scale; // The scale of the universe. Adjust this number to affect smoothness. float value = Perlin(x * scale, y * ...


0

I have found that fixed timesteps synchronized to 60fps gives mirror smooth animation. This is especially important for VR applications. Anything else is physically nauseating. Variable timesteps are unsuited for VR. Have a look at some Unity VR examples which use variable timesteps. It is unpleasant. The rule is if your 3D game is smooth in VR mode, it ...


0

From what I understand, you should be able to integrate the stream of haptic information from the CHAI3d or H3dApi frameworks with a DSP framework like http://aquila-dsp.org/. The 3D haptics frameworks should provide the collision detection required, without adding the complexity of another physics layer. This will generate a force effect that can drive ...


-1

I see two possible solutions. One, is to use a 3D Vector even in a 2D space, and keep one of the coordinates fixed to the same number. Another one, is to create two different classes, Vector2 and Vector3, both inheriting from a base Vector class, and make your systems work with this Vector class directly, looping trough its components.


5

Use a 3D vector. For your 2D components, simply ignore the third component. The extra "cost" of an unused float is trivial in comparison to the rest of your architecture, and things like std::unordered_map<std:;string, Component*> are of far greater performance and memory concern than an occasionally-unused float anyway. You say that this would be ...


5

When you say 'synthesis' do you mean pure analog/additive/FM synthesis from scratch, or would a sample-based approach be acceptable? If you can't use combinations of real-world audio samples then this is more complicated process. Trying to generate truly realistic sounds through synthesis isn't the standard way that most game/virtual instruments/sound ...


1

I believe the problem is that you're assuming that the ball is at a constant speed throughout the time step. The relevent parts of your code are: ball.y += ball.y_speed * deltaTime / 1000; ball.y_speed += 1.5 * deltaTime; Unfortunately, this method only gives an approximation of the position, and this is why you are seeing errors. You are not taking into ...


0

Try basing your calculations on system time if you want it to be non frame-rate dependent. The only thing I can say is that basing the movement calculations on frame-rate should mean that if the frame rate drops then then the ball should slow down with the frames. I have done something similar to this before and what I did is each gamestep or MainUpdate ...


0

There are a number of techniques used to solve this problem. Generally speaking the technique is called Inverse Kinematics, whereby after the pose is complete, the pose is modified to fit to a specific point - hence being Inverse Kinematics - http://en.wikipedia.org/wiki/Inverse_kinematics This can be solved through various means - animation or algorithm. ...


0

I could pass the character controller the array of points representing the island that it is currently colliding with, but then iterating through all of the points and finding the points closest to the character seems like a lot of work to do on each frame When the collision first occurs you could save the id/index of the point in the array that is ...



Top 50 recent answers are included