Anonymous | Login | Signup for a new account 2020-01-26 00:51 PST
 Main | My View | View Issues | Change Log | Roadmap | Summary | My Account

View Issue Details  Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006040opensim[REGION] Physics Enginespublic2012-06-01 23:082013-01-21 09:29
ReporterKayaker Magic
Assigned To
PrioritynormalSeveritymajorReproducibilityalways
StatusconfirmedResolutionopen
PlatformLinuxOSOpenSim 0.7.1.1 Release (UniOS Version
Product Version
Target VersionFixed in Version
Summary0006040: Vehicle linear motor is projected onto the region global XY plane
Description    The VEHICLE_LINEAR_MOTOR_DIRECTION vector acts as if it is projected onto the region global XY plane. An airplane, for example, should be able to climb by pitching its nose up then moving forward on it's own local X axis. However, when you do this in OpenSim, the airplane nose points up, but the motion is trapped in a global XY plane and the airplane just slides around, trapped at a fixed altitude. The same thing happens with VEHICLE_TYPE_BALLOON, which should be able to motor straight up or down, but cannot.

In an extreme test, I set the linear motor direction to <0,0,20>. A perfectly horizontal vehicle does not move at all, since the projection of this vector on the XY plane is <0,0,0>. But if the vehicle tilts slightly in any direction, it starts to move since the projection of the motor vector is now non zero. This makes for a pretty realistic helicopter simulation, if you use some other way (ex: hover height) to move the helicopter up and down. But I cannot find a way to get an airplane to fly out of its current altitude.
Steps To Reproduce    Make a box prim that is 2x1x.01 meters in XYZ. Position it high enough off the ground so that it can rotate freely. Put the script below into it. Every time you touch the prim, it should pitch up then move in the direction it is pointing. It will pitch up, but unfortunately it just slides around at a fixed
// Kayaker Magic aka Mike Kayaker
// Place this script in a prim that is far enough above ground to rotate freely.
// preferably something long in the local X direction so you can tell
// when it pitches its nose up.
// Touch the prim, it should pitch its nose up and move in the direction it is pointing.
// Unfortunately, it only moves along a global XY plane at the current altitude.
default
{
state_entry()
{
llSetStatus(STATUS_PHYSICS, FALSE); //disable physics on reset
llSetRot(ZERO_ROTATION); //reset to known rotation
llSetVehicleType(VEHICLE_TYPE_AIRPLANE); //simple vehicle, nothing fancy
llSetVehicleFloatParam( VEHICLE_BUOYANCY, 1.0); //make it float
llSetStatus(STATUS_PHYSICS,TRUE); //turn physics on when ready
}
touch_start(integer num)
{
llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, <0,-8,0>*llGetRot()); //pitch nose up
llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION,<1,0,0>); //move foreward
llSetTimerEvent(5);
}
timer()
{
llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION,<0,0,0>);
llSetTimerEvent(0);
}
}
TagsNo tags attached.
Git Revision or version numberunknown
Run ModeStandalone (1 Region)
Physics EngineODE
Script Engine
EnvironmentUnknown
Mono VersionOther
ViewerImpudence
Attached Files

 Relationships

 Notes Robert Adams (administrator) 2013-01-21 09:29 The operation of LINEAR_MOTOR_DIRECTION is properly in the vehicle coordinates and not fixed on the XY plane. The above script does exactly the same actions in SL and in OS with BulletSim.

 Issue History Date Modified Username Field Change 2012-06-01 23:08 Kayaker Magic New Issue 2012-06-06 20:31 justincc Status new => confirmed 2013-01-21 09:29 Robert Adams Note Added: 0023432