本文整理汇总了C#中PloobsEngine.Modelo.SimpleModel类的典型用法代码示例。如果您正苦于以下问题:C# SimpleModel类的具体用法?C# SimpleModel怎么用?C# SimpleModel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SimpleModel类属于PloobsEngine.Modelo命名空间,在下文中一共展示了SimpleModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadContent
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory ,IContentManager contentManager)
{
base.LoadContent(GraphicInfo, factory, contentManager);
{
SimpleModel simpleModel = new SimpleModel(factory, "Model//cenario");
TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
ForwardXNABasicShader shader = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default());
ForwardMaterial fmaterial = new ForwardMaterial(shader);
IObject obj = new IObject(fmaterial, simpleModel, tmesh);
this.World.AddObject(obj);
}
ConfigWriter cw = new ConfigWriter("teste.properties");
cw.AddKeyValue("teste", "value");
cw.Write();
ConfigReader cr = new ConfigReader("teste.properties");
cr.Read();
String v = cr.ReadValue("teste");
System.Diagnostics.Debug.Assert(v == "value");
this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo));
this.RenderTechnic.AddPostEffect(new BlackWhitePostEffect());
}
示例2: LoadContent
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory ,IContentManager contentManager)
{
base.LoadContent(GraphicInfo, factory, contentManager);
{
SimpleModel simpleModel = new SimpleModel(factory, "Model//cenario");
TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
ForwardXNABasicShader shader = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default());
ForwardMaterial fmaterial = new ForwardMaterial(shader);
IObject obj = new IObject(fmaterial, simpleModel, tmesh);
this.World.AddObject(obj);
}
for (int i = 0; i < 10; i++)
{
for (int j = 0; j < 10; j++)
{
SimpleModel simpleModel = new SimpleModel(factory, "Model//uzi");
TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, new Vector3(18 * j, 10, 8 * i), Matrix.Identity, Vector3.One * 10, MaterialDescription.DefaultBepuMaterial());
ForwardXNABasicShader shader = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default());
ForwardMaterial fmaterial = new ForwardMaterial(shader);
IObject obj = new IObject(fmaterial, simpleModel, tmesh);
obj.OnUpdate += new OnUpdate(obj_OnUpdate);
this.World.AddObject(obj);
}
}
this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo));
}
示例3: LoadContent
/// <summary>
/// Load content for the screen.
/// </summary>
/// <param name="GraphicInfo"></param>
/// <param name="factory"></param>
/// <param name="contentManager"></param>
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager)
{
base.LoadContent(GraphicInfo, factory, contentManager);
///Uncoment to add your model
SimpleModel simpleModel = new SimpleModel(factory, "Model/cenario");
///Physic info (position, rotation and scale are set here)
TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
///Forward Shader (look at this shader construction for more info)
ForwardXNABasicShader shader = new ForwardXNABasicShader();
///Deferred material
ForwardMaterial fmaterial = new ForwardMaterial(shader);
///The object itself
IObject obj = new IObject(fmaterial, simpleModel, tmesh);
///Add to the world
this.World.AddObject(obj);
///add a camera
this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo));
///task sample
taskSample taskSample = new taskSample();
///when ended, call this (syncronous -- specified in the itask implementation) function
taskSample.Ended += new Action<ITask, IAsyncResult>(taskSample_Ended);
///create and send the task to the processor
TaskCommand TaskCommand = new TaskCommand(taskSample);
CommandProcessor.getCommandProcessor().SendCommandAssyncronous(TaskCommand);
}
示例4: LoadContent
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory ,IContentManager contentManager)
{
base.LoadContent(GraphicInfo, factory, contentManager);
{
SimpleModel simpleModel = new SimpleModel(factory, "Model//cenario");
simpleModel.SetTexture(factory.CreateTexture2DColor(1,1,Color.Gray), TextureType.MULTITEX1);
TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
//ForwardDualTextureShader shader = new ForwardDualTextureShader();
ForwardEnvironmentShader shader = new ForwardEnvironmentShader(factory.GetTextureCube("Textures//grassCUBE"));
ForwardMaterial fmaterial = new ForwardMaterial(shader);
IObject obj = new IObject(fmaterial, simpleModel, tmesh);
this.World.AddObject(obj);
}
{
SimpleModel simpleModel = new SimpleModel(factory, "Model//uzi");
TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, new Vector3(100,10,10), Matrix.Identity, Vector3.One * 10, MaterialDescription.DefaultBepuMaterial());
ForwardXNABasicShader shader = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default());
ForwardMaterial fmaterial = new ForwardMaterial(shader);
IObject obj = new IObject(fmaterial, simpleModel, tmesh);
this.World.AddObject(obj);
}
this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo));
this.RenderTechnic.AddPostEffect(new BlackWhitePostEffect());
}
示例5: LoadContent
/// <summary>
/// Load content for the screen.
/// </summary>
/// <param name="GraphicInfo"></param>
/// <param name="factory"></param>
/// <param name="contentManager"></param>
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager)
{
base.LoadContent(GraphicInfo, factory, contentManager);
///Uncoment to add your model
SimpleModel simpleModel = new SimpleModel(factory, "Model/cenario");
///Physic info (position, rotation and scale are set here)
TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
///Forward Shader (look at this shader construction for more info)
ForwardXNABasicShader shader = new ForwardXNABasicShader();
///Forward material
ForwardMaterial fmaterial = new ForwardMaterial(shader);
///The object itself
IObject obj = new IObject(fmaterial, simpleModel, tmesh);
///Add to the world
this.World.AddObject(obj);
this.RenderTechnic.AddPostEffect(MotionBlurPostEffect);
this.RenderTechnic.AddPostEffect(BloomPostEffect);
BloomPostEffect.Enabled = false;
MotionBlurPostEffect.Enabled = false;
blurdefault = MotionBlurPostEffect.Amount;
RotatingCamera cam = new RotatingCamera(this, new Vector3(0,-100,-400));
this.World.CameraManager.AddCamera(cam);
RasterizerState = new RasterizerState();
RasterizerState.CullMode = CullMode.None;
}
示例6: LoadContent
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory ,IContentManager contentManager)
{
base.LoadContent(GraphicInfo, factory, contentManager);
{
SimpleModel simpleModel = new SimpleModel(factory, "Model//cenario");
TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
ForwardXNABasicShader shader = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default());
ForwardMaterial fmaterial = new ForwardMaterial(shader);
IObject obj = new IObject(fmaterial, simpleModel, tmesh);
this.World.AddObject(obj);
}
///using component
Billboard3D Billboard3D = new Billboard3D(factory.GetTexture2D("Textures\\grama1"), new Vector3(100, 20, 100), Vector2.One * 0.2f);
BillboardComponent.Billboards.Add(Billboard3D);
///using old mode (IObject billboard)
{
List<Billboard> poss = new List<Billboard>();
for (int i = 0; i < 10; i++)
{
for (int j = 0; j < 10; j++)
{
float x, y;
x = i * 10;
y = j * 10;
poss.Add(
new Billboard()
{
Position = new Vector3(x, 50 , y),
Scale = Vector2.One * 0.01f,
Enabled = true
}
);
}
}
CPUBillboardModel bm = new CPUBillboardModel(factory, "Bilbs", "..\\Content\\Textures\\tree", poss.ToArray());
ForwardAlphaTestShader cb = new ForwardAlphaTestShader(128,CompareFunction.GreaterEqual);
ForwardMaterial matfor = new ForwardMaterial(cb);
matfor.RasterizerState = RasterizerState.CullNone;
GhostObject go = new GhostObject();
IObject obj2 = new IObject(matfor, bm, go);
this.World.AddObject(obj2);
//Text Billboards
TextBillboard3D TextBillboard3D = new TextBillboard3D("TEST 123 SPHERICAL", Color.Black, new Vector3(100), 0.5f);
sBillboardComponent.Billboards.Add(TextBillboard3D);
TextBillboard3D = new TextBillboard3D("TEST 123 Cylinder", Color.Black, new Vector3(200, 50, 200), 0.5f);
cBillboardComponent.Billboards.Add(TextBillboard3D);
}
this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo));
}
示例7: DefaultTriangleMeshObj
protected IObject DefaultTriangleMeshObj(String modelName, Vector3 position, Vector3? scale = null, Matrix? orientation = null)
{
SimpleModel simpleModel = new SimpleModel(GraphicFactory, modelName);
TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, position, orientation, scale);
ForwardMaterial fmaterial = ForwardMaterial.DefaultForwardMaterial();
return new IObject(fmaterial, simpleModel, tmesh);
}
示例8: LoadContent
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory ,IContentManager contentManager)
{
base.LoadContent(GraphicInfo, factory, contentManager);
{
///Uncoment to add your model
SimpleModel simpleModel = new SimpleModel(factory, "Model/cenario");
///Physic info (position, rotation and scale are set here)
TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
///Forward Shader (look at this shader construction for more info)
ForwardXNABasicShader shader = new ForwardXNABasicShader();
///Deferred material
ForwardMaterial fmaterial = new ForwardMaterial(shader);
///The object itself
IObject obj = new IObject(fmaterial, simpleModel, tmesh);
///Add to the world
this.World.AddObject(obj);
}
{
SnowParticleSystem snow = new SnowParticleSystem();
DPFSParticleSystem ps = new DPFSParticleSystem("snow", snow);
this.World.ParticleManager.AddAndInitializeParticleSystem(ps);
///cant set emiter position before adding the particle
///IF YOU DO SO, IT WILL NOT WORK
snow.Emitter.PositionData.Position = new Vector3(500, 0, 0);
}
CameraFirstPerson cam = new CameraFirstPerson(MathHelper.ToRadians(-50), MathHelper.ToRadians(-10), new Vector3(-150, 150, 150), GraphicInfo);
this.World.CameraManager.AddCamera(cam);
}
示例9: LoadContent
/// <summary>
/// Load content for the screen.
/// </summary>
/// <param name="GraphicInfo"></param>
/// <param name="factory"></param>
/// <param name="contentManager"></param>
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager)
{
base.LoadContent(GraphicInfo, factory, contentManager);
#region Models
{
///Need to load the height, the normal texture and the difuse texture
SimpleModel sm = new SimpleModel(factory, "..\\Content\\Model\\block", "..\\Content\\Textures\\color_map");
sm.SetTexture("Textures\\normal_map", TextureType.BUMP);
sm.SetCubeTexture(factory.GetTextureCube("Textures//cubemap"),TextureType.ENVIRONMENT);
BoxObject pi = new BoxObject(new Vector3(200, 110, 0), 1, 1, 1, 5, new Vector3(100, 100, 100), Matrix.Identity, MaterialDescription.DefaultBepuMaterial());
DeferredEnvironmentCustomShader DeferredEnvironmentCustomShader = new DeferredEnvironmentCustomShader(false, true, false);
DeferredEnvironmentCustomShader.SpecularIntensity = 0.2f;
DeferredEnvironmentCustomShader.SpecularPower = 30;
DeferredEnvironmentCustomShader.ShaderId = ShaderUtils.CreateSpecificBitField(true);
IMaterial mat = new DeferredMaterial(DeferredEnvironmentCustomShader);
IObject obj3 = new IObject(mat, sm, pi);
this.World.AddObject(obj3);
}
{
SimpleModel simpleModel = new SimpleModel(factory, "Model//cenario");
TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
DeferredCustomShader shader = new DeferredCustomShader(false,false,false,false);
DeferredMaterial fmaterial = new DeferredMaterial(shader);
IObject obj = new IObject(fmaterial, simpleModel, tmesh);
this.World.AddObject(obj);
}
#endregion
#region NormalLight
DirectionalLightPE ld1 = new DirectionalLightPE(Vector3.Left, Color.White);
DirectionalLightPE ld2 = new DirectionalLightPE(Vector3.Right, Color.White);
DirectionalLightPE ld3 = new DirectionalLightPE(Vector3.Backward, Color.White);
DirectionalLightPE ld4 = new DirectionalLightPE(Vector3.Forward, Color.White);
DirectionalLightPE ld5 = new DirectionalLightPE(Vector3.Down, Color.White);
float li = 0.5f;
ld1.LightIntensity = li;
ld2.LightIntensity = li;
ld3.LightIntensity = li;
ld4.LightIntensity = li;
ld5.LightIntensity = li;
this.World.AddLight(ld1);
this.World.AddLight(ld2);
this.World.AddLight(ld3);
this.World.AddLight(ld4);
this.World.AddLight(ld5);
#endregion
CameraFirstPerson cam = new CameraFirstPerson(MathHelper.ToRadians(10), MathHelper.ToRadians(-10), new Vector3(200, 150, 250), GraphicInfo);
this.World.CameraManager.AddCamera(cam);
new LightThrowBepu(this.World, GraphicFactory);
SkyBoxSetTextureCube stc = new SkyBoxSetTextureCube("Textures//cubemap");
CommandProcessor.getCommandProcessor().SendCommandAssyncronous(stc);
}
示例10: LoadContent
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory ,IContentManager contentManager)
{
base.LoadContent(GraphicInfo, factory, contentManager);
{
SimpleModel simpleModel = new SimpleModel(factory, "Model//cenario");
TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
ForwardXNABasicShader shader = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default());
ForwardMaterial fmaterial = new ForwardMaterial(shader);
IObject obj = new IObject(fmaterial, simpleModel, tmesh);
this.World.AddObject(obj);
}
var newCameraFirstPerson = new CameraStatic(new Vector3(100,100,100), - new Vector3(100,100,100) );
this.World.CameraManager.AddCamera(newCameraFirstPerson);
SimpleConcreteGestureInputPlayable SimpleConcreteGestureInputPlayable = new SimpleConcreteGestureInputPlayable(Microsoft.Xna.Framework.Input.Touch.GestureType.DoubleTap, (sample) => doubleTapCount++);
this.BindInput(SimpleConcreteGestureInputPlayable);
this.BindInput(new SimpleConcreteGestureInputPlayable(Microsoft.Xna.Framework.Input.Touch.GestureType.Hold,
(sample) =>
{
this.RemoveInputBinding(SimpleConcreteGestureInputPlayable);
doubleTapDisabled = true;
}
));
}
示例11: SpawnPrimitive
/// <summary>
/// Create a simple Sphere object
/// </summary>
/// <param name="pos"></param>
/// <param name="ori"></param>
/// <returns></returns>
private IObject SpawnPrimitive(Vector3 pos, Matrix ori)
{
///Load a Model with a custom texture
sm2 = new SimpleModel(factory,"Model\\ball");
sm2.SetTexture(factory.CreateTexture2DColor(1,1,Color.White,false), TextureType.DIFFUSE);
IMaterial m;
if (forward)
{
ForwardXNABasicShader nd = new ForwardXNABasicShader();
m = new ForwardMaterial(nd);
}
else
{
DeferredNormalShader nd = new DeferredNormalShader();
m = new DeferredMaterial(nd);
}
PhysxPhysicWorld PhysxPhysicWorld = _mundo.PhysicWorld as PhysxPhysicWorld;
///First we create a shape description
SphereShapeDescription SphereGeometry = new SphereShapeDescription(ballSize);
///then we create the physic object
PhysxPhysicObject PhysxPhysicObject = new PhysxPhysicObject(SphereGeometry,
0.5f, Matrix.CreateTranslation(pos), Vector3.One * ballSize);
IObject o = new IObject(m, sm2, PhysxPhysicObject);
return o;
}
示例12: Player
public Player(IScreen screen, Vector3 position, Matrix rotation, SimpleModel model, float width, float height, Boolean useThirdPerson = false)
: base(screen, position, rotation, width, height, new Vector3(1F))
{
this.height = height * scale.Y;
charecter.CharacterController.HorizontalMotionConstraint.Speed = 50;
charecter.CharacterController.HorizontalMotionConstraint.MaximumForce = 10000;
charecter.CharacterController.JumpSpeed = 35;
mod = model;
obj = new IObject(Materials.dMaterial, mod, charecter);
Mouse.SetPosition(EngineSettings.graphicInfo.BackBufferWidth / 2, EngineSettings.graphicInfo.BackBufferHeight / 2);
bstate = Mouse.GetState();
rotSpeed = 0.05F;
zoomDistance = 50;
camera = new PlayerCamera(obj, (height / 2));
camera.HorizontalOffset = -camera.HorizontalOffset;
UpdateCamera();
firstPerson = !useThirdPerson;
this.Start();
}
示例13: LoadContent
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory ,IContentManager contentManager)
{
base.LoadContent(GraphicInfo, factory, contentManager);
{
SimpleModel simpleModel = new SimpleModel(factory, "Model//cenario");
TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
ForwardXNABasicShader shader = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default());
ForwardMaterial fmaterial = new ForwardMaterial(shader);
IObject obj = new IObject(fmaterial, simpleModel, tmesh);
this.World.AddObject(obj);
}
{
SimpleModel simpleModel = new SimpleModel(factory, "Model//uzi");
TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, new Vector3(100,10,10), Matrix.Identity, Vector3.One * 10, MaterialDescription.DefaultBepuMaterial());
ForwardXNABasicShader shader = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default());
ForwardMaterial fmaterial = new ForwardMaterial(shader);
IObject obj = new IObject(fmaterial, simpleModel, tmesh);
this.World.AddObject(obj);
}
this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo));
this.RenderTechnic.AddPostEffect(new BlackWhitePostEffect());
}
示例14: LoadContent
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory ,IContentManager contentManager)
{
///cast to out world instance
PhysxPhysicWorld PhysxPhysicWorld = World.PhysicWorld as PhysxPhysicWorld;
base.LoadContent(GraphicInfo, factory, contentManager);
{
SimpleModel simpleModel = new SimpleModel(factory, "Model//cenario");
///Physic Triangle mesh (same as bepu)
PhysxTriangleMesh tmesh = new PhysxTriangleMesh(PhysxPhysicWorld,simpleModel,
Matrix.Identity, Vector3.One);
ForwardXNABasicShader shader = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default());
ForwardMaterial fmaterial = new ForwardMaterial(shader);
IObject obj = new IObject(fmaterial, simpleModel, tmesh);
this.World.AddObject(obj);
}
///Ball Throw !!!
BallThrowPhysx28 BallThrowBullet = new BallThrowPhysx28(this.World, GraphicFactory);
this.AttachCleanUpAble(BallThrowBullet);
this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo));
}
示例15: LoadContent
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory ,IContentManager contentManager)
{
base.LoadContent(GraphicInfo, factory, contentManager);
{
SimpleModel simpleModel = new SimpleModel(factory, "Model//cenario");
TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
ForwardXNABasicShader shader = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default());
ForwardMaterial fmaterial = new ForwardMaterial(shader);
IObject obj = new IObject(fmaterial, simpleModel, tmesh);
this.World.AddObject(obj);
}
{
SimpleModel simpleModel = new SimpleModel(factory, "Model//uzi");
MobileMeshObject tmesh = new MobileMeshObject(simpleModel, new Vector3(100, 100, 10), Matrix.Identity, Vector3.One * 50, MaterialDescription.DefaultBepuMaterial(),BEPUphysics.CollisionShapes.MobileMeshSolidity.DoubleSided,10);
//TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, new Vector3(100, 100, 10), Matrix.Identity, Vector3.One * 50, MaterialDescription.DefaultBepuMaterial());
ForwardXNABasicShader shader = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default());
ForwardMaterial fmaterial = new ForwardMaterial(shader);
IObject obj = new IObject(fmaterial, simpleModel, tmesh);
this.World.AddObject(obj);
}
new LightThrowBepu(this.World, factory);
this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo));
}