<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: 'Calibri'; COLOR: #000000">
<DIV>I am working on a script for a submarine and am having issues with it 
working fine in ubode but will not dive or surface in Bullet physics.</DIV>
<DIV> </DIV>
<DIV>Here are the primary items that are involved with the physics.</DIV>
<DIV> </DIV>
<DIV>This is the initial settings the object is set with.</DIV>
<DIV> </DIV>
<DIV>set_engine(){</DIV>
<DIV>    llSetVehicleType(VEHICLE_TYPE_BOAT);</DIV>
<DIV>    
llSetVehicleFloatParam(VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 0.5);</DIV>
<DIV>    llSetVehicleFloatParam(VEHICLE_LINEAR_MOTOR_TIMESCALE, 
0.1);</DIV>
<DIV>    
llSetVehicleFloatParam(VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 0.1);</DIV>
<DIV>    
llSetVehicleFloatParam(VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 0.80);</DIV>
<DIV>    
llSetVehicleVectorParam(VEHICLE_LINEAR_FRICTION_TIMESCALE, <1, 1, 
1>);        </DIV>
<DIV>    
llSetVehicleFloatParam(VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 0.2);</DIV>
<DIV>    
llSetVehicleFloatParam(VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 1.0);</DIV>
<DIV>    llSetVehicleFloatParam(VEHICLE_ANGULAR_MOTOR_TIMESCALE, 
0.5);</DIV>
<DIV>    
llSetVehicleFloatParam(VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 0.2);</DIV>
<DIV>    
llSetVehicleVectorParam(VEHICLE_ANGULAR_FRICTION_TIMESCALE, <0.1, 0.1, 
0.1>);</DIV>
<DIV>    
llSetVehicleFloatParam(VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 0.5);</DIV>
<DIV>    
llSetVehicleFloatParam(VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 1.0);</DIV>
<DIV>    llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, 0.0); // 
set ball at water surface</DIV>
<DIV>    llSetVehicleFloatParam( VEHICLE_HOVER_EFFICIENCY, 0.5 
);</DIV>
<DIV>    llSetVehicleFloatParam( VEHICLE_HOVER_TIMESCALE, 1.0 ); 
</DIV>
<DIV>}</DIV>
<DIV> </DIV>
<DIV>These are the controls and they work fine in ubODE, but CONTROL_UP and 
CONTROL_DOWN do nothing in Bullet.</DIV>
<DIV> </DIV>
<DIV>control(key id, integer level, integer edge)</DIV>
<DIV>    {</DIV>
<DIV>        float    
gForwardThrust; // variable for forward thrust </DIV>
<DIV>        float    
gReverseThrust = -1.5; // reverse thrust backup speed</DIV>
<DIV>        if(level & 
CONTROL_FWD)</DIV>
<DIV>        {</DIV>
<DIV>            
Swimming();</DIV>
<DIV>            
gForwardThrust = 3; // normal forward speed</DIV>
<DIV>            vTarget 
= llGetPos(); // get our current position</DIV>
<DIV>            // if 
near region edge, slow down</DIV>
<DIV>            if 
(vTarget.x > xlimit || vTarget.x < gGuard || vTarget.y > ylimit || 
vTarget.y < gGuard) </DIV>
<DIV>            {</DIV>
<DIV>                
if (vTarget.x > xlimit) vTarget.x = xlimit;</DIV>
<DIV>                
if (vTarget.x < gGuard) vTarget.x = gGuard;</DIV>
<DIV>                
if (vTarget.y > xlimit) vTarget.y = ylimit;</DIV>
<DIV>                
if (vTarget.y < gGuard) vTarget.y = gGuard;</DIV>
<DIV>                
gForwardThrust = .3; // slow us down</DIV>
<DIV>                
llWhisper(0, "Approaching sim edge, drive away...");</DIV>
<DIV>            }</DIV>
<DIV>            if ( 
vTarget.z < (llGround ( ZERO_VECTOR ) + 0.35) )</DIV>
<DIV>            
{    // too shallow and going to collide with land</DIV>
<DIV>                
gForwardThrust = .05; // slow us down</DIV>
<DIV>                
llWhisper(0, "Too shallow, drive away...");</DIV>
<DIV>            }</DIV>
<DIV>            
llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, 
<gForwardThrust,0,0>);</DIV>
<DIV>        }</DIV>
<DIV>        if(level & 
CONTROL_BACK)</DIV>
<DIV>        {</DIV>
<DIV>            
llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, 
<gReverseThrust,0,0>); // back us up</DIV>
<DIV>            
return;</DIV>
<DIV>        }</DIV>
<DIV>        if(level & 
(CONTROL_UP))</DIV>
<DIV>        {</DIV>
<DIV>            
HovHeightBase = HovHeightBase + 0.02;</DIV>
<DIV>            
llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, HovHeightBase);</DIV>
<DIV>        }</DIV>
<DIV>        if(level & 
(CONTROL_DOWN))</DIV>
<DIV>        {</DIV>
<DIV>            
HovHeightBase = HovHeightBase - 0.02;</DIV>
<DIV>            
llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, HovHeightBase);</DIV>
<DIV>        }</DIV>
<DIV>        if(level & 
(CONTROL_RIGHT|CONTROL_ROT_RIGHT)) 
llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, <0, 
0,-5.0>);</DIV>
<DIV>        if(level & 
(CONTROL_LEFT|CONTROL_ROT_LEFT)) 
llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, <0, 0, 
5.0>);</DIV>
<DIV>        if(edge & ~level & 
(CONTROL_FWD|CONTROL_BACK)) Treading();</DIV>
<DIV>    }</DIV>
<DIV> </DIV>
<DIV>I might add this is actually from my swim ball script which also works just 
fine in ubODE but fails in Bullet on the dive and surface actions.</DIV>
<DIV> </DIV>
<DIV>In bullet nothing at all happens.</DIV>
<DIV> </DIV>
<DIV>Is this a bug in opensim?  I know it is expected a script that works 
in one physics engine is suppose to work in the other physics engines as 
well.</DIV>
<DIV> </DIV>
<DIV>Not being an expert at script writing, it is possible I stumbled into doing 
something wrong that ubODE can deal with and Bullet can’t.</DIV>
<DIV> </DIV>
<DIV>Tom</DIV>
<DIV> </DIV></DIV></DIV></BODY></HTML>