* Added more spinning parts to ComplexObject.
* We now have CylinderShape * This commit dedicated to the birth of techno house.afrisby
parent
2fe9b8139c
commit
a4602515ce
|
@ -16,7 +16,23 @@ namespace OpenSim.Framework.Types
|
||||||
public enum HollowShape : byte
|
public enum HollowShape : byte
|
||||||
{
|
{
|
||||||
Same = 0,
|
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
|
public class PrimitiveBaseShape
|
||||||
|
@ -59,7 +75,7 @@ namespace OpenSim.Framework.Types
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public HollowShape HoleShape
|
public HollowShape HollowShape
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
@ -87,6 +103,7 @@ namespace OpenSim.Framework.Types
|
||||||
|
|
||||||
public PrimitiveBaseShape()
|
public PrimitiveBaseShape()
|
||||||
{
|
{
|
||||||
|
PCode = (byte)PCodeEnum.Primitive;
|
||||||
ExtraParams = new byte[1];
|
ExtraParams = new byte[1];
|
||||||
TextureEntry = m_defaultTextureEntry;
|
TextureEntry = m_defaultTextureEntry;
|
||||||
}
|
}
|
||||||
|
@ -116,15 +133,14 @@ namespace OpenSim.Framework.Types
|
||||||
public BoxShape()
|
public BoxShape()
|
||||||
: base()
|
: base()
|
||||||
{
|
{
|
||||||
PathCurve = 16;
|
PathCurve = (byte) Extrusion.Straight;
|
||||||
ProfileShape = ProfileShape.Square;
|
ProfileShape = ProfileShape.Square;
|
||||||
PCode = 9;
|
|
||||||
PathScaleX = 100;
|
PathScaleX = 100;
|
||||||
PathScaleY = 100;
|
PathScaleY = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BoxShape(float side)
|
public BoxShape(float side)
|
||||||
: base()
|
: this()
|
||||||
{
|
{
|
||||||
SetSide(side);
|
SetSide(side);
|
||||||
}
|
}
|
||||||
|
@ -151,15 +167,14 @@ namespace OpenSim.Framework.Types
|
||||||
public CylinderShape()
|
public CylinderShape()
|
||||||
: base()
|
: base()
|
||||||
{
|
{
|
||||||
PathCurve = 16;
|
PathCurve = (byte)Extrusion.Straight;
|
||||||
ProfileShape = ProfileShape.Circle;
|
ProfileShape = ProfileShape.Circle;
|
||||||
PCode = 9;
|
|
||||||
PathScaleX = 100;
|
PathScaleX = 100;
|
||||||
PathScaleY = 100;
|
PathScaleY = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CylinderShape(float radius, float heigth)
|
public CylinderShape(float radius, float heigth)
|
||||||
: base()
|
: this()
|
||||||
{
|
{
|
||||||
SetRadius(radius);
|
SetRadius(radius);
|
||||||
SetHeigth(heigth);
|
SetHeigth(heigth);
|
||||||
|
@ -167,7 +182,7 @@ namespace OpenSim.Framework.Types
|
||||||
|
|
||||||
private void SetHeigth(float heigth)
|
private void SetHeigth(float heigth)
|
||||||
{
|
{
|
||||||
Scale.Y = heigth;
|
Scale.Z = heigth;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetRadius(float radius)
|
private void SetRadius(float radius)
|
||||||
|
|
|
@ -14,11 +14,12 @@ namespace SimpleApp
|
||||||
|
|
||||||
private class RotatingWheel : SceneObjectPart
|
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)
|
public RotatingWheel(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, LLVector3 groupPosition, LLVector3 offsetPosition, LLQuaternion rotationDirection)
|
||||||
: base(regionHandle, parent, ownerID, localID, BoxShape.Default, groupPosition, offsetPosition )
|
: base(regionHandle, parent, ownerID, localID, new CylinderShape( 0.5f, 0.2f ), groupPosition, offsetPosition )
|
||||||
{
|
{
|
||||||
|
m_rotationDirection = rotationDirection;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void UpdateMovement()
|
public override void UpdateMovement()
|
||||||
|
@ -39,8 +40,14 @@ namespace SimpleApp
|
||||||
{
|
{
|
||||||
m_rotationDirection = new LLQuaternion(0.05f, 0.1f, 0.15f);
|
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, 0.75f), new LLQuaternion(0.05f,0,0)));
|
||||||
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.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();
|
UpdateParentIDs();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue