public void UpdatePointLights(GamePlay.SceneGraph.GSceneGraph ViewScene) { if (ViewScene == null) { return; } for (int i = 0; i < ViewScene.PointLights.Count; i++) { if (ViewScene.PointLights[i] == null) { continue; } this.SetPointLight((UInt32)i, ref ViewScene.PointLights[i].PointLightInitializer.LightDesc); } }
public static bool AddActor2Scene(GamePlay.GGameInstance game, GamePlay.Actor.GActor actor, Guid sceneId) { GamePlay.SceneGraph.GSceneGraph scene = null; if (sceneId == Guid.Empty) { sceneId = game.World.DefaultScene.SceneId; } scene = game.World.GetScene(sceneId); if (scene == null) { return(false); } game.World.AddActor(actor); scene.AddActor(actor); return(true); }
//物理反馈的数据不精确 待优化 private bool CheckBoxInPhy(GamePlay.GWorld world, ref BoundingBox box, ref Vector3 pos, ref Quaternion rotation)//float dis, float offset { GamePlay.SceneGraph.GSceneGraph DefaultScene = world.DefaultScene; Bricks.PhysicsCore.CPhyScene PhyScene = DefaultScene.PhyScene; var shape = CEngine.Instance.PhyContext.CreateShapeBox(PhysicsCore.CPhyMaterial.DefaultPhyMaterial, box.GetSize().X, box.GetSize().Y, box.GetSize().Z); GamePlay.SceneGraph.VHitResult result = new GamePlay.SceneGraph.VHitResult(); Matrix mat1 = Matrix.Transformation(Vector3.UnitXYZ, Quaternion.Identity, box.GetCenter()); Matrix mat2 = Matrix.Transformation(Vector3.UnitXYZ, rotation, pos); Matrix mat3 = mat1 * mat2; Vector3 scale; Vector3 position; Quaternion rot; mat3.Decompose(out scale, out rot, out position); return(PhyScene.Overlap(shape, position, rot, ref result)); }