mirror of
https://github.com/opensim/opensim.git
synced 2026-08-02 23:18:34 +08:00
Start of replacing the old SceneObject/Primitive classes with the new versions.
PLEASE NOTE: that with this revision some prim related features may be broke for a while. (things like linking prims and the parcel prim count.) Also this revision may not work on mono, but that will be fixed soon.
This commit is contained in:
@@ -9,12 +9,12 @@ using System.Diagnostics;
|
||||
|
||||
namespace SimpleApp
|
||||
{
|
||||
public class CpuCounterObject : SceneObject
|
||||
public class CpuCounterObject : SceneObjectGroup
|
||||
{
|
||||
private PerformanceCounter m_counter;
|
||||
|
||||
public CpuCounterObject(Scene world, EventManager eventManager, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape)
|
||||
: base(world, eventManager, ownerID, localID, pos, shape )
|
||||
public CpuCounterObject(Scene world, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape)
|
||||
: base(world, regionHandle, ownerID, localID, pos, shape )
|
||||
{
|
||||
String objectName = "Processor";
|
||||
String counterName = "% Processor Time";
|
||||
@@ -27,7 +27,7 @@ namespace SimpleApp
|
||||
{
|
||||
float cpu = m_counter.NextValue() / 40f;
|
||||
LLVector3 size = new LLVector3(cpu, cpu, cpu);
|
||||
rootPrimitive.ResizeGoup( size );
|
||||
//rootPrimitive.ResizeGoup( size );
|
||||
|
||||
base.UpdateMovement();
|
||||
}
|
||||
|
||||
@@ -11,16 +11,16 @@ using Primitive=OpenSim.Region.Environment.Scenes.Primitive;
|
||||
|
||||
namespace SimpleApp
|
||||
{
|
||||
public class FileSystemObject : SceneObject
|
||||
public class FileSystemObject : SceneObjectGroup
|
||||
{
|
||||
public FileSystemObject(Scene world, FileInfo fileInfo, LLVector3 pos)
|
||||
: base( world, world.EventManager, LLUUID.Zero, world.NextLocalId, pos, BoxShape.Default )
|
||||
: base( world, world.RegionInfo.RegionHandle, LLUUID.Zero, world.NextLocalId, pos, BoxShape.Default )
|
||||
{
|
||||
|
||||
|
||||
float size = (float)Math.Pow((double)fileInfo.Length, (double) 1 / 3) / 5;
|
||||
rootPrimitive.ResizeGoup(new LLVector3(size, size, size));
|
||||
rootPrimitive.Text = fileInfo.Name;
|
||||
// rootPrimitive.ResizeGoup(new LLVector3(size, size, size));
|
||||
// rootPrimitive.Text = fileInfo.Name;
|
||||
}
|
||||
|
||||
public override void Update()
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace SimpleApp
|
||||
shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f);
|
||||
LLVector3 pos = new LLVector3(138, 129, 27);
|
||||
|
||||
SceneObject sceneObject = new CpuCounterObject(scene, scene.EventManager, LLUUID.Zero, scene.PrimIDAllocate(), pos, shape);
|
||||
SceneObjectGroup sceneObject = new CpuCounterObject(scene, regionInfo.RegionHandle, LLUUID.Zero, scene.PrimIDAllocate(), pos, shape);
|
||||
scene.AddEntity(sceneObject);
|
||||
|
||||
MyNpcCharacter m_character = new MyNpcCharacter( scene.EventManager );
|
||||
|
||||
Reference in New Issue
Block a user