Page MenuHomeFeedback Tracker

Please add setVelocityModelSpace command to complement velocityModelSpace
Closed, ResolvedPublic


from velocity commands we have

setVelocityTransformation which has little to do with actual velocity

now desperately need setVelocityModelSpace


Legacy ID
Operating System
Windows 7
Feature Request
Steps To Reproduce

try to set velocity of the object relative to the object itself

Event Timeline

Killzone_Kid edited Additional Information. (Show Details)
Killzone_Kid set Category to Feature Request.
Killzone_Kid set Reproducibility to Always.
Killzone_Kid set Severity to None.
Killzone_Kid set Resolution to Open.
Killzone_Kid set Legacy ID to 4229479660.May 7 2016, 3:48 PM
Killzone_Kid edited a custom field.
Bohemia added a subscriber: Dwarden.Aug 2 2013, 4:17 PM
fred64 added a subscriber: fred64.May 7 2016, 3:48 PM

this is also related to the other request

in order to control vehicle physics from script you should be able to set velocity and rotation in model space, you could use setVelocity but thir requires a matrix transformation on the script, whereas setvelocity in modelspace could be sent to Physx as it is a supported command.

Tajin added a subscriber: Tajin.May 7 2016, 3:48 PM

Generally speaking, every "get" command should always have its equivalent "set" command (or the other way around).

To name just a few: "setMass" and "setObjectTexture" are both missing their "get"-equivalent.

Well this command would ease things up but it's not really necessary.
I'm still upvoting this
You can use this:

_deg = (direction _vehicle);

if(_deg < 90 && _deg >= 0) then {
_deg = 90 - _deg;
} else {
if(_deg <=360 && _deg >= 90) then {

		_deg = 450 - _deg;


_velXT = _velX * cos(-1*_deg) - _velY * sin(-1*_deg);
_velYT = _velX * sin(-1*_deg) + _velY * cos(-1*_deg);

and transforming it back into world space would be something like this

_newVelX = _newVelXT * cos(_deg) - _newVelYT * sin(_deg);
_newVelY = _newVelXT * sin(_deg) + _newVelYT * cos(_deg);

this is correct if you work on a land vehicle (yaw), but in an air vehicle such as an helicopter you must also factor pitch and roll.. so the vertical component of velocities and there it becomes complicated...

You are right, I only did a cylindrical transformation which actually only works on flat terrain.

In your case you would have to use Euler angles. Still doable but of course I expect no one to understand this.

LouMontana closed this task as Resolved.Nov 6 2020, 2:44 PM
LouMontana updated the task description. (Show Details)
LouMontana edited Additional Information. (Show Details)
LouMontana set Operating System to Windows 7.