/// <summary> /// Constructs a cube at a given location and size. /// </summary> /// <param name="pos" type="Vector3">The position of the cube, at it's center, [X,Y,Z]</param> /// <param name="dim" type="Vector3">The size of the cube.</param> /// <returns>A UUID for the newly created cube or UUID.Zero on failure.</returns> /// </summary> public PrimitiveBaseShape createCube(Vector3 pos, Vector3 dim, UUID TextureID) { // Construct a cube at a given position, size and texture UUID. PrimitiveBaseShape cubeShape = PrimitiveBaseShape.CreateBox();// new PrimitiveBaseShape(); cubeShape.ToOmvPrimitive(pos, Quaternion.Identity); cubeShape.Scale = dim; sceneGraph.AddNewPrim(UUID.Zero, UUID.Zero, pos, Quaternion.Identity, cubeShape); return(cubeShape); }
/// <summary> /// Constructs a cube at a given location and size. /// </summary> /// <param name="pos" type="Vector3">The position of the cube, at it's center, [X,Y,Z]</param> /// <param name="dim" type="Vector3">The size of the cube.</param> /// <returns>A UUID for the newly created cube or UUID.Zero on failure.</returns> /// </summary> private PrimitiveBaseShape createCube(Vector3 pos, Vector3 dim, UUID TextureID) { // Construct a cube at a given position, size and texture UUID. PrimitiveBaseShape cubeShape = PrimitiveBaseShape.CreateBox();// new PrimitiveBaseShape(); cubeShape.ToOmvPrimitive(pos, Quaternion.Identity); cubeShape.Scale = dim; // place into the region at given position // texture the object from the given texture id, if this texture is not found // then default to use one of the standard textures it knows about that // during first run it will create and store in the asset database (todo). return(cubeShape); // return createCube(pos, dim, TextureID); }
/// <summary> /// Calculate a hash that takes both the prim shape and materials into account /// </summary> public ulong GetPrimHash(PrimitiveBaseShape shape) { Primitive prim = shape.ToOmvPrimitive(Vector3.Zero, Quaternion.Identity); return(GetPrimHash(prim, shape)); }