Tag Info

Hot answers tagged

5

This code is taking the collision between two spheres and moving them based on their masses and velocity. Here's a really basic illustration to show why there is penetration between a blue ball and a green wall. In this example the center of the ball is 5 feet from the edge of the wall. The ball is moving at 1 foot per second and you are running at a ...


4

I think the crucial part of this question is how you can procedurally generate stable structures (as generating an unstable pile of blocks in real time should be no problem) My approach would be to prebuild sub structures that are guaranteed to be stable. Have each substructure store two sets of spans" * one for the bottom where it requires contact below ...


4

Blender 3D is open source, and free. It is a modeling and rendering application, but it comes with easy to use soft-body, fluid, and ridged-body physics solvers. You could set up a number of slightly different simulations, that match the dimensions of the area in your game, and export the animation data from blender to use in your engine. In the game, ...


4

What you're doing sounds a lot like premature optimization to me. Did you try using the physics-engine and did it actually turn out to cause performance issues? If you don't need the physics-simulation and just care for the collisions, why not use sensors (or "triggers", as they are called in Unity). For stationary objects, use a collider with the Is ...


3

The documentation isn't terribly clear on it—and I'm not currently in a position to verify it—but I believe that the force applied from RigidBody.AddForce() (link) is applied at that object's root location (at its transform.position). If not at transform.position, then at the object's RigidBody.centerOfMass (link). If you want to apply a force ...


3

This article discusses solving fixed distance constraints (which sound to me like your fixed joints) between particles by relaxation -- specifically you want the section "Solving several concurrent constraints by relaxation" on page 2, I think. I found this article approachable enough years ago when I was implementing something similar, so hopefully it will ...


2

You could 'cheat' the system.. An 8 sided die only has 8 possible values. If you randomly pick a number you could then play 1 of 8 animations that end on the number that was randomly generated. You would not get it to look like a random roll every time, but it would roll to a randomly generated number. A second step to the canned animations would be ...


2

Rather than building a solid object for your tentacles, I would suggest instead using a single linear chain — a 'skeleton' for the tentacle — and then procedurally wrapping a descending sequence of trapezoids around it, out to the tip. Use the local orientation information to define crossbars at each vertex (e.g., normal to the average or ...


1

To find a good algorithm for such a stance will take quite some time, observation and testing, I don't think you will find a "one-fits-all" solution on the internet. There is a lot you have to consider for skeletons climbing obstacles and I assume you don't only want it to take a certain stance, but to move from one to another in a realistic way. "Specific ...


1

Tentacles work in nature (and robotics) because of muscles inside, this means that each segment or three is only locally affected by a small number of forces. It sounds like you have a setup where all the force starts at the base and propagates outwards, which gets you a whip instead of a twisting tentacle. You may want to build a system with small forces ...


1

Of course it can be, but it won't be easy. Look at Spore by EA, they did it in 3D, and their level of freedom in designing your creatures there is amazing, and your creations there are complex simulated living organisms. What you want is something much simpler. What you will need is a validation system to follow a set of rules. You can't just go off ...


1

I tried to replicate your example and you're right: I had to set the plane's material to Ice to see the cube moving as it should. Without a material set to the plane, the cube won't "slide" forward (will do a simple somersault) for values like 25, and for bigger values (like 250) the cube's behaviour is really weird!!! (it moves forward, that moves ...


1

I'd go with spheres. When you grow, add new spheres to the existing ones (at different directions) more to the 'base spheres', less to the farther away ones, organized like this : Sphere B is 100 units from sphere A at "vector" 0.7 ; 0.3 ; -0.4 or just use the final vector 70.0 ; 30.0 ; -40 to connect B to A. You can even predefine the link points on ...


1

This is an interesting question Just thinking out load ( well writing it down) you know the position of A, Vector2 you know the position of B, also Vector2 you can calculate the distance between A and B => C = SQRT( (Bx - Ax)² + (By - Ay)²) the equal distance between the 2 points is C/2. mmm. I'v been drawing up to 10 different triangles and I think I ...


1

There is interpenetration because every time a ball's position and velocity is changed, it needs to be checked to see if it has collided with any other ball that was checked earlier in the loop. For instance, given 3 balls: Start 1. Ball #A is checked against Ball #B, no collision Ball #A is checked against Ball #C, no collision Ball #B is checked against ...


1

SphereCollisionImplicit() gets called after the spheres have moved. That movement could have ended up with collision & interpenetration, this method resolves that. start frame: elsewhere in your code, the position is updated by velocity. Then this method is called to see if that resulted in collision/penetration. if so, it separates them & ...



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