private void RenderAnimations(float timeSinceLastFrame, RegionContextBase rcontext, RegionRenderInfo rri)
 {
     AnimatBase.ProcessAnimations(timeSinceLastFrame, rri);
 }
Beispiel #2
0
        public void RenderUpdate(IEntity ent, UpdateCodes what)
        {
            m_log.Log(LogLevel.DRENDERDETAIL, "RenderUpdate: {0} for {1}", ent.Name.Name, what);
            bool fullUpdate = false;

            lock (ent) {
                if (ent is LLEntityBase && ((what & UpdateCodes.New) != 0))
                {
                    CreateNewPrim((LLEntityBase)ent);
                    fullUpdate = true;
                }
                if ((what & UpdateCodes.Animation) != 0)
                {
                    // the prim has changed its rotation animation
                    IAnimation anim;
                    if (ent.TryGet <IAnimation>(out anim))
                    {
                        m_log.Log(LogLevel.DRENDERDETAIL, "RenderUpdate: animation ");
                        RegionRenderInfo rri;
                        if (ent.RegionContext.TryGet <RegionRenderInfo>(out rri))
                        {
                            lock (rri) {
                                rri.animations.Add(AnimatBase.CreateAnimation(anim, ((LLEntityBase)ent).Prim.LocalID));
                            }
                        }
                    }
                }
                if ((what & UpdateCodes.Text) != 0)
                {
                    // text associated with the prim changed
                    m_log.Log(LogLevel.DRENDERDETAIL, "RenderUpdate: text changed");
                }
                if ((what & UpdateCodes.Particles) != 0)
                {
                    // particles associated with the prim changed
                    m_log.Log(LogLevel.DRENDERDETAIL, "RenderUpdate: particles changed");
                }
                if (!fullUpdate && (what & (UpdateCodes.Scale | UpdateCodes.Position | UpdateCodes.Rotation)) != 0)
                {
                    // world position has changed. Tell Ogre they have changed
                    try {
                        m_log.Log(LogLevel.DRENDERDETAIL, "RenderUpdate: Updating position/rotation for {0}", ent.Name.Name);
                        RegionRenderInfo rri;
                        if (ent.RegionContext.TryGet <RegionRenderInfo>(out rri))
                        {
                            lock (rri.renderPrimList) {
                                // exception if the casting does not work
                                if (((LLEntityBase)ent).Prim != null)
                                {
                                    uint localID = ((LLEntityBase)ent).Prim.LocalID;
                                    if (rri.renderPrimList.ContainsKey(localID))
                                    {
                                        RenderablePrim rp = rri.renderPrimList[localID];
                                        rp.Position = new OMV.Vector3(ent.RegionPosition.X, ent.RegionPosition.Y, ent.RegionPosition.Z);
                                        rp.Rotation = new OMV.Quaternion(ent.Heading.X, ent.Heading.Y, ent.Heading.Z, ent.Heading.W);
                                    }
                                }
                            }
                        }
                    }
                    catch (Exception e) {
                        m_log.Log(LogLevel.DBADERROR, "RenderUpdate: FAIL updating pos/rot: {0}", e);
                    }
                }
            }
            return;
        }