From ef0fea268fde12b6279de067332f608554a8a1ac Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Wed, 8 Aug 2007 11:16:45 +0000 Subject: * Got SimpleApp working again * Minor shape koncept experiments --- .../Framework/General/Types/PrimitiveBaseShape.cs | 90 ++++++++++++---------- OpenSim/Region/Examples/SimpleApp/Program.cs | 5 +- 2 files changed, 53 insertions(+), 42 deletions(-) diff --git a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs index 41a58fe..045569b 100644 --- a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs @@ -3,27 +3,24 @@ using libsecondlife.Packets; namespace OpenSim.Framework.Types { - //public enum ShapeType - //{ - // Box, - // Sphere, - // Ring, - // Tube, - // Torus, - // Prism, - // Scuplted, - // Cylinder, - // Foliage, - // Unknown - //} - - + public enum ProfileShape : byte + { + Circle = 0, + Square = 1, + IsometricTriangle = 2, + EquilateralTriangle = 3, + RightTriangle = 4, + HalfCircle = 5 + } - public class PrimitiveBaseShape + public enum HollowShape : byte { - //protected ShapeType m_type = ShapeType.Unknown; - + Same = 0, + // Fill in... + } + public class PrimitiveBaseShape + { private static byte[] m_defaultTextureEntry; public byte PCode; @@ -49,13 +46,31 @@ namespace OpenSim.Framework.Types public byte[] TextureEntry; // a LL textureEntry in byte[] format public byte[] ExtraParams; - //public ShapeType PrimType - //{ - // get - // { - // return this.m_type; - // } - //} + public ProfileShape ProfileShape + { + get + { + return (ProfileShape)(ProfileCurve & 0xf); + } + set + { + byte oldValueMasked = (byte)(ProfileCurve & 0xf0); + ProfileCurve = (byte)(oldValueMasked | (byte)value); + } + } + + public HollowShape HoleShape + { + get + { + return (HollowShape)(ProfileHollow & 0xf0); + } + set + { + byte oldValueMasked = (byte)(ProfileHollow & 0xf0); + ProfileHollow = (byte)(oldValueMasked | (byte)value); + } + } public LLVector3 PrimScale { @@ -88,36 +103,29 @@ namespace OpenSim.Framework.Types } } - enum ProfileShape - { - Circle = 0, - Square = 1, - IsometricTriangle = 2, - EquilateralTriangle = 3, - RightTriangle = 4, - HalfCircle = 5 - } - public class GenericShape : PrimitiveBaseShape - { - + { public GenericShape() : base() { - } + } } public class BoxShape : PrimitiveBaseShape { public BoxShape() : base() { - //m_type = ShapeType.Box; PathCurve = 16; - ProfileCurve = 1; + ProfileShape = ProfileShape.Square; PCode = 9; PathScaleX = 100; PathScaleY = 100; } + + public void SetSide( float side ) + { + Scale = new LLVector3( side, side, side ); + } public static BoxShape Default { @@ -125,7 +133,7 @@ namespace OpenSim.Framework.Types { BoxShape boxShape = new BoxShape(); - boxShape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); + boxShape.SetSide( 0.5f ); return boxShape; } diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs index 50b0780..db71578 100644 --- a/OpenSim/Region/Examples/SimpleApp/Program.cs +++ b/OpenSim/Region/Examples/SimpleApp/Program.cs @@ -47,11 +47,14 @@ namespace SimpleApp { base.StartUp(); + m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache); + m_log.Notice(m_log.LineInfo); ScenePresence.PhysicsEngineFlying = true; IPEndPoint internalEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9000); + RegionInfo regionInfo = new RegionInfo(1000, 1000, internalEndPoint, "localhost"); regionInfo.DataStore = "simpleapp_datastore.yap"; @@ -67,7 +70,7 @@ namespace SimpleApp LLVector3 pos = new LLVector3(138, 129, 27); SceneObject sceneObject = new CpuCounterObject(scene, scene.EventManager, LLUUID.Zero, scene.PrimIDAllocate(), pos, shape); - scene.AddEntity(sceneObject); + scene.AddEntity(sceneObject); MyNpcCharacter m_character = new MyNpcCharacter( scene.EventManager ); scene.AddNewClient(m_character, false); -- cgit v1.1