Collisions (ohysics) for Missiles, Bullets, Explosions etc


ok so sometimes, I would stall the motor, and warm up my lunch on it


robots have a sense of humour, and put up with a lot of shit, except putting the decimal point in the wrong place, this is the cardinal sin - I coded up to seven axes, which is just like a bone hierarchy in a game


its really hard man, to code for many axes, when theres hammers smashing everywhere around you - and not make any mistakes, no errors, no floating point issues, no dot in the wrong spot


I was pondering earlier today how a proper AI might only be able to laugh uncontrollably (mainly at us) after it took in enough information.


I wish I could show you my work on gpu nnai for games, it scared the shit out of me


we’re wayyy off topic, take it to pm


:cactus: :oncoming_police_car:


lets back to this very basic question, should we? :joy:


Elaborating on my earlier post:

So you could multiply the mass of the bullet by it’s speed and apply that force to the target hit. That would be somewhat realistic. But you may want to increase the force and throw realism out the window, like they do in Hollywood, making a single bullet throw a person through the air.


ok so we have a ray, it has a direction, and theoretically infinite length, but for the purposes of working out the force, we have direction, mass, and force, where force is, in terms of guns, related to the exit velocity - we can compute the force that left the gun, apply drag and friction and any other slowdowns, and at the end of its travel, when it hits the target, we can make some assumptions, based on what we think we know about physics - its a game, we get to play with the input values, and make them plausible in our game - wait thats wrong, we need to make the OUTCOME plausible, and how we did it, what math cheats we took, are not relevant to the user


the magic in the magic show, is not in the hand or hat of the magician, its in his assistants underwear, its mostly slight of hand, doing the actual math is too slow, so we find ways to approximate it and get it done, getting shit done is the word of mouth way the game industry works, if you can get shit done, you get a job, and if you cant, you get the sack, its not a perfect world - but you can learn real magic from people around you, and apply it


:thinking: but the mass times speed wont equal force at all


assuming the bullet is moving in a perfect vacuum, the force will be speed times mass, a basic newtonian physics constant, which I think personally is bullshit, because nothing is perfect, and the universe (mostly) sucks

In a few weeks, I am going back to school, to get a teaching certificate

Newton was very bright, but he did not define our physical world, he merely attempted to define it using the state of the art math he had back then.


:rofl:i think i can trust you guys in this one…

now lets talk about explosions, can i do a great number of RaycastSingle()s from the explosion origin to all different directions with the length being its effective diameter, instead of doing a SphereCast()?
and i wonder if this can be possibly done in 1/60 second?

cuz if i do a SphereCast() to find out the targets being affected by the explosion, i cant think of a way to determine if those targets are behind covers or not :thinking:


Just, no. you can do a few ray casts, but a shitload of raycasts costs a shitload. Your app will have a heart attack and you’ll feel foolish for trying to do a death star explosion with a physics engine.
In physics you get what you paid for, which is why in games, we try to avoid paying full cost

By the way, the original death star explosion in star wars took months, using supercomputers of their era


:sob:then any suggestions for determining if a target is behind cover or not? if im to use SphereCast()?




Ah, but it is not mass times speed: It’s mass times acceleration; a change in speed… and let’s assume the bullet instantly comes to a full stop upon impact.
This also means that when no forces (like gravity, drag or collisions) are applied to an object it will continue at the same velocity (linear and angular), in the same direction. Like an asteroid in deep space.

You could use a spherecast to find the objects that you would then each check with one or several raycasts for possible escaping of the blast.


this raycasts here is the new question, how to do them? :thinking:
i mean how do i determine the parameters for the raycasts


Go over some of the examples that use raycasts.