/// <summary> /// /// </summary> /// <param name="gameObject"></param> public NGraphics(GameObject gameObject) { this.gameObject = gameObject; _alpha = 1f; _shader = ShaderConfig.imageShader; _color = Color.white; _meshFactory = this; meshFilter = gameObject.AddComponent <MeshFilter>(); meshRenderer = gameObject.AddComponent <MeshRenderer>(); meshRenderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off; meshRenderer.reflectionProbeUsage = UnityEngine.Rendering.ReflectionProbeUsage.Off; meshRenderer.receiveShadows = false; mesh = new Mesh(); mesh.name = gameObject.name; mesh.MarkDynamic(); meshFilter.mesh = mesh; meshFilter.hideFlags = DisplayObject.hideFlags; meshRenderer.hideFlags = DisplayObject.hideFlags; mesh.hideFlags = DisplayObject.hideFlags; Stats.LatestGraphicsCreation++; }
public override void Initialize() { _milkShapeMeshfactory = new MilkShape3DMeshFactory(); //Prepare Textured Block rendering when equiped ============================================================== _milkShapeMeshfactory.LoadMesh(@"\Meshes\block.txt", out _cubeMeshBluePrint, 0); base.Initialize(); }
public EllipseMesh GetMeshFactoryEM() { if (!(_meshFactory is EllipseMesh)) { _meshFactory = new EllipseMesh(); _meshDirty = true; } return((EllipseMesh)_meshFactory); }
public PolygonMesh GetMeshFactoryPM() { if (!(_meshFactory is PolygonMesh)) { _meshFactory = new PolygonMesh(); _meshDirty = true; } return((PolygonMesh)_meshFactory); }
public LineMesh GetMeshFactoryLM() { if (!(_meshFactory is LineMesh)) { _meshFactory = new LineMesh(); _meshDirty = true; } return((LineMesh)_meshFactory); }
/// <summary> /// /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> public T GetMeshFactory <T>() where T : IMeshFactory, new() { if (!(_meshFactory is T)) { _meshFactory = new T(); _meshDirty = true; } return((T)_meshFactory); }
public WorldSerializer(IMeshFactory meshFactory, DiskTileDataFactory diskTileDataFactory, IXNAGame game, SimpleMeshRenderer renderer, SimpleWorldObjectTypeFactory worldObjectTypeFactory, TileSnapInformationBuilder builder) { this.meshFactory = meshFactory; this.diskTileDataFactory = diskTileDataFactory; this.game = game; this.renderer = renderer; this.worldObjectTypeFactory = worldObjectTypeFactory; this.builder = builder; }
public WorldObjectPlaceTool(IXNAGame _game, World _world, SimpleMeshRenderer _renderer, TileSnapInformationBuilder _builder, IMeshFactory meshFactory, ITileFaceTypeFactory tileFaceTypeFactory) { game = _game; World = _world; renderer = _renderer; builder = _builder; this.meshFactory = meshFactory; this.tileFaceTypeFactory = tileFaceTypeFactory; worldTileSnapper = new WorldTileSnapper(builder); }
/// <summary> /// /// </summary> public NGraphics() { enabled = true; _color = Color.White; _meshFactory = this; _vertices = new List <Vector3>(); _uv0 = new List <Vector2>(); _colors = new List <Color>(); _triangles = new List <int>(); Stats.LatestGraphicsCreation++; }
public override void Initialize() { if (ClientSettings.Current.Settings.GraphicalParameters.StaticEntityViewSize > (ClientSettings.Current.Settings.GraphicalParameters.WorldSize / 2) - 2.5) { _staticEntityViewRange = (int)((ClientSettings.Current.Settings.GraphicalParameters.WorldSize / 2) - 2.5) * 16; } else { _staticEntityViewRange = ClientSettings.Current.Settings.GraphicalParameters.StaticEntityViewSize * 16; } _milkShapeMeshfactory = new MilkShape3DMeshFactory(); //Prepare Textured Block rendering when equiped ============================================================== _milkShapeMeshfactory.LoadMesh(@"\Meshes\block.txt", out _cubeMeshBluePrint, 0); }
public ClientGame( ILogger logger, GameSettings gameSettings, IShaderFactory shaderFactory, IChunkProvider chunkProvider) : base(logger, gameSettings, shaderFactory) { _shaderFactory = shaderFactory; _chunkProvider = chunkProvider; Window.Title = "Ashoka"; _clearColor = new Color4(0.1f, 0.1f, 0.1f, 1.0f); _inputLayoutFactory = new InputLayoutFactory(); _textureAtlas = new TextureAtlas(32, "Content/Textures/LandAtlas.png"); _chunkMeshFactory = new ChunkMeshFactory(_textureAtlas); _meshFactory = new MeshFactory(); }
public DiskTileDataFactory(IMeshFactory meshFactory, ITileFaceTypeFactory tileFaceTypeFactory) { this.meshFactory = meshFactory; this.tileFaceTypeFactory = tileFaceTypeFactory; }
public ShapeFactory(IMeshFactory meshFactory, IPrimitiveFactory primitiveFactory) { _meshFactory = meshFactory; _primitiveFactory = primitiveFactory; }
/// <summary> /// Crear un nuevo Loader /// </summary> public TgcSkeletalLoader() { this.device = GuiController.Instance.D3dDevice; texturesDict = new Dictionary <string, TgcTexture>(); this.meshFactory = new DefaultMeshFactory(); }
/// <summary> /// Crear un nuevo Loader /// </summary> public TgcSceneLoader() { this.device = GuiController.Instance.D3dDevice; this.meshFactory = new DefaultMeshFactory(); }
public SimpleStaticWorldObjectFactory(SimpleMeshRenderer renderer, IMeshFactory meshFactory) { this.renderer = renderer; this.meshFactory = meshFactory; }
public SpriteBatch(IMeshFactory meshFactory) =>
/// <summary> /// Crear un nuevo Loader /// </summary> public TgcSkeletalLoader() { this.device = GuiController.Instance.D3dDevice; texturesDict = new Dictionary<string, TgcTexture>(); this.meshFactory = new DefaultMeshFactory(); }
public ChunkRenderer(IMeshFactory meshFactory, ITextureAtlas blockTextureAtlas) { this.meshFactory = meshFactory; this.blockTextureAtlas = blockTextureAtlas; }
public CubeRenderer(D3DEngine engine, VisualWorldParameters visualWorldParameters) { _engine = engine; _visualWorldParameters = visualWorldParameters; _milkShapeMeshfactory = new MilkShape3DMeshFactory(); }
public override void Initialize() { _milkShapeMeshfactory = new MilkShape3DMeshFactory(); }
public SceneFactory(IMeshFactory meshFactory, ITextureFactory textureFactory, ILogger <SceneFactory> logger) { this.meshFactory = meshFactory; this.textureFactory = textureFactory; this.logger = logger; }