public void Update(float dt) { if (!mAdd) { TransformComponent tc = mObject.GetComponent <TransformComponent>(); ModelComponent mc = mObject.GetComponent <ModelComponent>(); CPlusPlusInterface.AddMovingBoxCollider(mObject.GetName(), tc.mPosition, tc.mScale, tc.mRotation, mc.mModel.Model, mPassable, mTag); mAdd = true; } else { TransformComponent tc = mObject.GetComponent <TransformComponent>(); ModelComponent mc = mObject.GetComponent <ModelComponent>(); CPlusPlusInterface.UpdateMovingBoxCollider(mObject.GetName(), tc.mPosition, tc.mScale, tc.mRotation, mc.mModel.Model, mPassable, mTag); } }
public void Shutdown() { if (mAdd) { CPlusPlusInterface.RemoveMovingBoxCollider(mObject.GetName()); } SetOnCollision(null); }
public void InitialiseModel() { if (AnimationController != 0) { ShutdownModel(); } Console.WriteLine("Initialising model: " + Model); AnimationController = CPlusPlusInterface.CreateAnimationController(Model); }
public void Draw(float dt) { foreach (var dummy in mDummies) { CPlusPlusInterface.DrawObject(dummy.mPosition, mAllScale, mAllRot, "Sphere", dummy.mMaterial.Material, (int)BHModel.ANIMATION.INVALID); } }
public void Draw(float dt) { if (mLightCount != mPositions.Count) { Resize(); } #if DEMO_SCRIPT // Clamp time value to 0 to 1 mTime += 0.5f * dt; mTime = (mTime >= 1.0f) ? mTime - 1.0f : mTime; double angle = (double)mTime * 2.0 * Math.PI; float xOffset = (float)Math.Cos(angle) * mPathRadius; float yOffset = (float)Math.Sin(angle) * mPathRadius; BHVector3f offset = new BHVector3f(xOffset, yOffset, 0.0f); #else BHVector3f offset = new BHVector3f(0.0f, 0.0f, 0.0f); #endif // Draw local lights for (int i = 0; i < mLightCount; ++i) { BHVector3f pos = mPositions[i] + offset; CPlusPlusInterface.DrawLight(pos, mColors[i], 10.0f); } // Draw window light if (!mLightOff) { CPlusPlusInterface.DrawLight(new BHVector3f(10.0f, 10.0f, 0.0f), new BHVector4f(1.0f, 1.0f, 1.0f, 1.0f), new BHVector3f(-1.0f, -1.0f, 0.0f), new BHVector3f(10.0f, 10.0f, 20.0f)); } }
public void ShutdownModel() { CPlusPlusInterface.DeleteAnimationController(AnimationController); AnimationController = (int)ANIMATION.INVALID; }