* Added more spinning parts to ComplexObject.

* We now have CylinderShape
* This commit dedicated to the birth of techno house.
afrisby
lbsa71 2007-08-15 18:02:05 +00:00
parent 2fe9b8139c
commit a4602515ce
2 changed files with 37 additions and 15 deletions

View File

@ -16,9 +16,25 @@ namespace OpenSim.Framework.Types
public enum HollowShape : byte
{
Same = 0,
// Fill in...
Circle = 16,
Square =32,
Triangle = 48
}
public enum PCodeEnum : byte
{
Primitive = 9,
Avatar = 47
}
public enum Extrusion : byte
{
Straight = 16,
Curve1 = 32,
Curve2 = 48,
Flexible = 128
}
public class PrimitiveBaseShape
{
private static byte[] m_defaultTextureEntry;
@ -59,7 +75,7 @@ namespace OpenSim.Framework.Types
}
}
public HollowShape HoleShape
public HollowShape HollowShape
{
get
{
@ -87,6 +103,7 @@ namespace OpenSim.Framework.Types
public PrimitiveBaseShape()
{
PCode = (byte)PCodeEnum.Primitive;
ExtraParams = new byte[1];
TextureEntry = m_defaultTextureEntry;
}
@ -116,15 +133,14 @@ namespace OpenSim.Framework.Types
public BoxShape()
: base()
{
PathCurve = 16;
PathCurve = (byte) Extrusion.Straight;
ProfileShape = ProfileShape.Square;
PCode = 9;
PathScaleX = 100;
PathScaleY = 100;
}
public BoxShape(float side)
: base()
: this()
{
SetSide(side);
}
@ -151,15 +167,14 @@ namespace OpenSim.Framework.Types
public CylinderShape()
: base()
{
PathCurve = 16;
PathCurve = (byte)Extrusion.Straight;
ProfileShape = ProfileShape.Circle;
PCode = 9;
PathScaleX = 100;
PathScaleY = 100;
}
public CylinderShape(float radius, float heigth)
: base()
: this()
{
SetRadius(radius);
SetHeigth(heigth);
@ -167,7 +182,7 @@ namespace OpenSim.Framework.Types
private void SetHeigth(float heigth)
{
Scale.Y = heigth;
Scale.Z = heigth;
}
private void SetRadius(float radius)

View File

@ -14,11 +14,12 @@ namespace SimpleApp
private class RotatingWheel : SceneObjectPart
{
private static LLQuaternion m_rotationDirection = new LLQuaternion(0.05f, 0, 0);
private LLQuaternion m_rotationDirection;
public RotatingWheel(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, LLVector3 groupPosition, LLVector3 offsetPosition)
: base(regionHandle, parent, ownerID, localID, BoxShape.Default, groupPosition, offsetPosition )
public RotatingWheel(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, LLVector3 groupPosition, LLVector3 offsetPosition, LLQuaternion rotationDirection)
: base(regionHandle, parent, ownerID, localID, new CylinderShape( 0.5f, 0.2f ), groupPosition, offsetPosition )
{
m_rotationDirection = rotationDirection;
}
public override void UpdateMovement()
@ -38,10 +39,16 @@ namespace SimpleApp
: base(scene, regionHandle, ownerID, localID, pos, BoxShape.Default )
{
m_rotationDirection = new LLQuaternion(0.05f, 0.1f, 0.15f);
AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0, 1f)));
AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0, -1f)));
AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0, 0.75f), new LLQuaternion(0.05f,0,0)));
AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0, -0.75f), new LLQuaternion(-0.05f,0,0)));
AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0.75f,0), new LLQuaternion(0.5f, 0, 0.05f)));
AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, -0.75f,0), new LLQuaternion(-0.5f, 0, -0.05f)));
AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0.75f, 0, 0), new LLQuaternion(0, 0.5f, 0.05f)));
AddPart(new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(-0.75f, 0, 0), new LLQuaternion(0, -0.5f, -0.05f)));
UpdateParentIDs();
}
}