XML/JS fixes to movement and terrain conformance.
This was SVN commit r4338.
This commit is contained in:
parent
b0e7085fb9
commit
cd792eeb8e
@ -6,7 +6,7 @@
|
||||
<Anchor>
|
||||
<Type>Ground</Type>
|
||||
<!-- If negative or > 90.0, entity will always conform to terrain (assuming traits.pitch allows it) -->
|
||||
<ConformX>0</ConformX>
|
||||
<ConformX>3.141592</ConformX>
|
||||
<ConformZ>3.141592</ConformZ>
|
||||
</Anchor>
|
||||
</Traits>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<Anchor>
|
||||
<Type>Ground</Type>
|
||||
<!-- If negative or > 90.0, entity will always conform to terrain (assuming traits.pitch allows it) -->
|
||||
<ConformX>0</ConformX>
|
||||
<ConformX>3.141592</ConformX>
|
||||
<ConformZ>3.141592</ConformZ>
|
||||
</Anchor>
|
||||
</Traits>
|
||||
|
@ -71,7 +71,7 @@
|
||||
|
||||
<Pitch>
|
||||
<Sectors>7</Sectors>
|
||||
<Value>.1</Value>
|
||||
<Value>0.2</Value>
|
||||
</Pitch>
|
||||
|
||||
<IsTerritoryCentre>false</IsTerritoryCentre>
|
||||
|
@ -22,7 +22,6 @@
|
||||
<Event On="Notification" Function="entityEventNotification" />
|
||||
<Event On="Formation" Function="entityEventFormation" />
|
||||
<Event On="Idle" Function="entityEventIdle" />
|
||||
<Event On="Movement" Function="entityEventMovement" />
|
||||
<Event On="Death" Function="entityDestroyed" />
|
||||
<Event On="Initialize" Function="entityInit" />
|
||||
</Entity>
|
@ -46,6 +46,11 @@
|
||||
<Promotion>
|
||||
<Req>900</Req>
|
||||
</Promotion>
|
||||
|
||||
<Anchor>
|
||||
<ConformX>3.141592</ConformX>
|
||||
<ConformZ>3.141592</ConformZ>
|
||||
</Anchor>
|
||||
</Traits>
|
||||
|
||||
<Actions>
|
||||
|
@ -15,6 +15,11 @@
|
||||
|
||||
</Id>
|
||||
|
||||
<Anchor>
|
||||
<ConformX>3.141592</ConformX>
|
||||
<ConformZ>3.141592</ConformZ>
|
||||
</Anchor>
|
||||
|
||||
</Traits>
|
||||
|
||||
</Entity>
|
@ -1049,33 +1049,14 @@ function entityComplete()
|
||||
{
|
||||
console.write( this + " is finished building." );
|
||||
}
|
||||
|
||||
//=====================================================================
|
||||
|
||||
function entityEventIdle( evt )
|
||||
{
|
||||
//Use our own data for target; we aren't affecting anyone, so listeners want to know about us
|
||||
this.forceCheckListeners( NOTIFY_IDLE, this );
|
||||
}
|
||||
//=====================================================================
|
||||
function entityEventMovement( evt )
|
||||
{
|
||||
var divs = this.traits.pitch.sectors;
|
||||
var sector = this.findSector( divs, evt.slope, 3.141592, true );
|
||||
|
||||
if ( divs % 2 )
|
||||
{
|
||||
sector += ((divs+1)/2 - sector)*2;
|
||||
sector -= (divs+1)/2;
|
||||
this.actions.move.speedCurr = this.actions.move.speed;
|
||||
this.actions.move.speedCurr += this.actions.move.speed*this.traits.pitch.value*sector;
|
||||
}
|
||||
else
|
||||
{
|
||||
sector += ((divs)/2 - sector)*2;
|
||||
sector -= (divs)/2;
|
||||
this.actions.move.speedCurr = this.actions.move.speed;
|
||||
this.actions.move.speedCurr += this.actions.move.speed*this.traits.pitch.value*sector;
|
||||
}
|
||||
}
|
||||
|
||||
// ====================================================================
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user