Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
PhysicsDebugEffect.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using SiliconStudio.Core.Mathematics;
4 using SiliconStudio.Core.Serialization;
5 using SiliconStudio.Paradox.Effects.Modules;
6 using SiliconStudio.Paradox.Graphics;
7 using SiliconStudio.Paradox.Shaders;
8 
9 namespace SiliconStudio.Paradox.Physics
10 {
11  public partial class PhysicsDebugEffect : Effect
12  {
13  private static EffectBytecode bytecode;
14 
15  public PhysicsDebugEffect(GraphicsDevice graphicsDevice)
16  : base(graphicsDevice, bytecode ?? (bytecode = BinarySerialization.Read<EffectBytecode>(binaryBytecode)))
17  {
18  Color = new Color4(1.0f);
19  WorldViewProj = Matrix.Identity;
20  UseUv = true;
21  }
22 
23  public Color4 Color
24  {
25  get
26  {
27  return Parameters.Get(PhysicsDebugEffectKeys.Color);
28  }
29  set
30  {
31  Parameters.Set(PhysicsDebugEffectKeys.Color, value);
32  }
33  }
34 
35  public Matrix WorldViewProj
36  {
37  get
38  {
39  return Parameters.Get(PhysicsDebugEffectKeys.WorldViewProj);
40  }
41 
42  set
43  {
44  Parameters.Set(PhysicsDebugEffectKeys.WorldViewProj, value);
45  }
46  }
47 
48  public bool UseUv
49  {
50  get
51  {
52  return Parameters.Get(PhysicsDebugEffectKeys.UseUv) > 0.5;
53  }
54  set
55  {
56  Parameters.Set(PhysicsDebugEffectKeys.UseUv, value ? 1.0f : 0.0f);
57  }
58  }
59  }
60 }
Binary serialization method helpers to easily read/write data from a stream.
Represents a color in the form of rgba.
Definition: Color4.cs:42
Performs primitive-based rendering, creates resources, handles system-level variables, adjusts gamma ramp levels, and creates shaders. See The+GraphicsDevice+class to learn more about the class.
PhysicsDebugEffect(GraphicsDevice graphicsDevice)
SiliconStudio.Core.Mathematics.Color Color
Definition: ColorPicker.cs:14
Represents a 32-bit color (4 bytes) in the form of RGBA (in byte order: R, G, B, A).
Definition: Color.cs:16
using SiliconStudio.Paradox. Physics
Contains a compiled shader with bytecode for each stage.
Represents a 4x4 mathematical matrix.
Definition: Matrix.cs:47