I have an idea in my head that involves using model actors for vehicles like tanks, and a 3d landscape with uneven ground, so lots of slopes.
Of course, the vehicles should align themselves to the floor, has anyone ever attempted something like this?
My idea would be to use A_SetPitch and A_SetRoll with an angle that is computed by using GetZAt at two points, one at the front and one at the back of the vehicle.
Align actor to sloped floor
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
- RiboNucleic Asshat
- Posts: 501
- Joined: Thu May 09, 2013 8:15 pm
- Preferred Pronouns: No Preference
- Graphics Processor: nVidia with Vulkan support
- Location: Exactly where I am
- Contact:
Re: Align actor to sloped floor
I believe Nashgore: Vengeance Edition contains code for aligning an actor to the slope of a plane. You can find the relevant code in NashGoreStatics.zc:
Spoiler:You could study this and adapt it to your needs. Possibly ask ZZYZX about it too.
Re: Align actor to sloped floor
Do note that that is useless for vehicles because its sample point is the middle of the actor. For vehicles, you need at least 4 sample points (one at each wheel).
Re: Align actor to sloped floor
Thanks for the tip. Now I have to figure out the math