/// <summary> /// Construct a leaderless pack. /// </summary> /// <param name="theStage"> the scene</param> /// <param name="label"> name of pack</param> /// <param name="meshFile"> model of pack instance</param> public Pack(Stage theStage, string label, string meshFile) : base(theStage, label, meshFile) { isCollidable = true; leader = null; random = new Random(); }
/// <summary> /// Create an Agent. /// All Agents are collidable and have a single instance Object3D named agentObject. /// Set StepSize, create first, follow and above cameras. /// Set first as agentCamera /// <param name="stage"></param> /// <param name="label"></param> /// <param name="position"></param> /// <param name="orientAxis"></param> /// <param name="radians"></param> /// <param name="meshFile"></param> /// </summary> public Agent(Stage stage, string label, Vector3 position, Vector3 orientAxis, float radians, string meshFile) : base(stage, label, meshFile) { addObject(position, orientAxis, radians); agentObject = instance.First<Object3D>(); first = new Camera(stage, agentObject, Camera.CameraEnum.FirstCamera); follow = new Camera(stage, agentObject, Camera.CameraEnum.FollowCamera); above = new Camera(stage, agentObject, Camera.CameraEnum.AboveCamera); stage.addCamera(first); stage.addCamera(follow); stage.addCamera(above); agentCamera = first; }
public void setSurfaceHeight(Object3D anObject3D) { float terrainHeight = terrain.surfaceHeight((anObject3D.Translation.X), (anObject3D.Translation.Z)); anObject3D.Translation = new Vector3(anObject3D.Translation.X, terrainHeight, anObject3D.Translation.Z); }
// Methods public bool isCollidable(Object3D obj3d) { if (collidable.Contains(obj3d)) return true; else return false; }
public void addObject(Vector3 position, Vector3 orientAxis, float radians) { Object3D obj3d = new Object3D(stage, this, String.Format("{0}.{1}", name, instance.Count), position, orientAxis, radians, Vector3.One); obj3d.updateBoundingSphere(); // need to do only once for Model3D instance.Add(obj3d); if (IsCollidable) stage.Collidable.Add(obj3d); }
/// <summary> /// Construct a pack with an Object3D leader /// </summary> /// <param name="theStage"> the scene </param> /// <param name="label"> name of pack</param> /// <param name="meshFile"> model of a pack instance</param> /// <param name="aLeader"> Object3D alignment and pack center </param> public Pack(Stage theStage, string label, string meshFile, Object3D aLeader) : base(theStage, label, meshFile) { isCollidable = true; leader = aLeader; }
public Camera(Stage aScene, Object3D anAgentObject, CameraEnum cameraType) { scene = aScene; agent = anAgentObject; cameraCase = cameraType; }