mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
* Worked some more on SimpleApp
* Removed SceneObject references to RegionHandle, ParcelManager, EventManager as they are public on Scene * Moved PulseScript behaviour into MySceneObject
This commit is contained in:
40
OpenSim/Region/Examples/SimpleApp/MySceneObject.cs
Normal file
40
OpenSim/Region/Examples/SimpleApp/MySceneObject.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using OpenSim.Region.Environment.Scenes;
|
||||
using libsecondlife;
|
||||
using OpenSim.Framework.Types;
|
||||
using System.Timers;
|
||||
|
||||
namespace SimpleApp
|
||||
{
|
||||
public class MySceneObject : SceneObject
|
||||
{
|
||||
LLVector3 delta = new LLVector3(0.1f, 0.1f, 0.1f);
|
||||
|
||||
public MySceneObject(Scene world, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape)
|
||||
: base(world, ownerID, localID, pos, shape )
|
||||
{
|
||||
Timer timer = new Timer();
|
||||
timer.Enabled = true;
|
||||
timer.Interval = 100;
|
||||
timer.Elapsed += new ElapsedEventHandler(this.Heartbeat);
|
||||
}
|
||||
|
||||
public void Heartbeat(object sender, EventArgs e)
|
||||
{
|
||||
if (rootPrimitive.Scale.X > 1)
|
||||
{
|
||||
delta = new LLVector3(-0.1f, -0.1f, -0.1f);
|
||||
}
|
||||
|
||||
if (rootPrimitive.Scale.X < 0.2f)
|
||||
{
|
||||
delta = new LLVector3(0.1f, 0.1f, 0.1f);
|
||||
}
|
||||
|
||||
rootPrimitive.ResizeGoup(rootPrimitive.Scale + delta);
|
||||
update();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user