本文整理汇总了C#中System.Color.ToVector3方法的典型用法代码示例。如果您正苦于以下问题:C# Color.ToVector3方法的具体用法?C# Color.ToVector3怎么用?C# Color.ToVector3使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Color
的用法示例。
在下文中一共展示了Color.ToVector3方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawCube
private static void DrawCube(StructureData str, float size, KeyValuePair<Vector3I, Element> c, ref Color color, string text)
{
var local = Matrix.CreateScale(size * 1.02f) * Matrix.CreateTranslation(c.Key * size + new Vector3(0, -c.Value.CurrentOffset / 20.0f, 0));
Matrix box = local * str.m_grid.WorldMatrix;
//ten = c.Value.DistanceToStatic.ToString();
MyRenderProxy.DebugDrawOBB(box, color.ToVector3(), 0.5f, true, true);
MyRenderProxy.DebugDrawText3D(box.Translation, text, c.Value.Cubes.Count > 1 ? Color.Black : Color.White, 0.5f, false, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER);
}
示例2: DebugDraw
internal override void DebugDraw(ref Vector3D worldTranslation, Color color)
{
var translation = MatrixD.CreateTranslation(worldTranslation + m_translation);
var primary = (m_primaryRadius + m_secondaryRadius) * 2;
var secondary = m_secondaryRadius * 2;
var scale = MatrixD.CreateScale(primary, secondary, primary);
MatrixD rotation;
MatrixD.CreateFromQuaternion(ref m_invRotation, out rotation);
MatrixD.Transpose(ref rotation, out rotation); // inverse
var mat = scale * rotation * translation;
VRageRender.MyRenderProxy.DebugDrawCylinder(mat, color.ToVector3(), 0.5f, true, false);
}
示例3: DebugDraw
internal override void DebugDraw(ref Vector3D worldTranslation, Color color)
{
VRageRender.MyRenderProxy.DebugDrawSphere(worldTranslation + m_translation, m_radius, color.ToVector3(), alpha: 0.5f, depthRead: true, smooth: false);
}
示例4: DrawCube
private void DrawCube(float size, Vector3I pos, ref Color color, string text)
{
var local = Matrix.CreateScale(size * 1.02f) * Matrix.CreateTranslation(pos * size);
Matrix box = local * m_grid.WorldMatrix;
MyRenderProxy.DebugDrawOBB(box, color.ToVector3(), 0.5f, true, true);
if (DrawText && text != null && text != "0.00" && (Vector3D.Distance(box.Translation, Sandbox.Game.World.MySector.MainCamera.Position) < 30))
MyRenderProxy.DebugDrawText3D(box.Translation, text, Color.White, 0.5f, false, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER);
}
示例5: DebugDraw
internal override void DebugDraw(ref Vector3D worldTranslation, Color color)
{
VRageRender.MyRenderProxy.DebugDrawSphere(worldTranslation + m_translation, m_shapeAttributes.Diameter, color.ToVector3(), alpha: 0.5f, depthRead: true, smooth: false);
foreach (var noiseSector in m_cachedNoise)
{
}
}
示例6: SetAllColors
public void SetAllColors(Color newColor)
{
m_light.Color = newColor.ToVector4();
m_light.ReflectorColor = newColor.ToVector4();
m_light.SpecularColor = newColor.ToVector3();
}
示例7: OnMyShadowCheckEnable
/*
public void OnMyShadowCheckEnable(MyGuiControlCheckbox sender)
{
foreach (MyPrefabLight prefabLight in m_prefabLights)
{
MyLight myLight = prefabLight.GetLight();
if (sender == m_spotLightShadowCheckbox)
{
myLight.ShadowsEnabled = sender.Checked;
}
prefabLight.OnWorldPositionChanged(this);
prefabLight.UpdateEffect();
}
OnComponentChange(null);
}
*/
void OnComponentChange(MyGuiControlSlider sender)
{
foreach (MyPrefabLight prefabLight in m_prefabLights)
{
MyLight light = prefabLight.GetLight();
Color tmpColor = new Color();
tmpColor.R = (byte)m_pointNormalLightColorSlider[0].GetValue();
tmpColor.G = (byte)m_pointNormalLightColorSlider[1].GetValue();
tmpColor.B = (byte)m_pointNormalLightColorSlider[2].GetValue();
light.Color = tmpColor.ToVector4();
tmpColor.R = (byte)m_specularLightColorSlider[0].GetValue();
tmpColor.G = (byte)m_specularLightColorSlider[1].GetValue();
tmpColor.B = (byte)m_specularLightColorSlider[2].GetValue();
light.SpecularColor = tmpColor.ToVector3();
light.Falloff = m_pointFallOffSlider.GetValue(); // allowed values 0.1f-5.0f
light.Range = m_pointRangeSlider.GetValue(); // allowed values 0.0f-MyLightsConstants.MAX_POINTLIGHT_RADIUS
light.Intensity = prefabLight.m_IntensityMax = m_pointIntensitySlider.GetValue(); // allowed values 0.0f-10.0f
light.PointLightOffset = m_pointOffsetSlider.GetValue();
tmpColor.R = (byte)m_spotNormalLightColorSlider[0].GetValue();
tmpColor.G = (byte)m_spotNormalLightColorSlider[1].GetValue();
tmpColor.B = (byte)m_spotNormalLightColorSlider[2].GetValue();
light.ReflectorColor = tmpColor.ToVector4();
light.ReflectorFalloff = m_spotFallOffSlider.GetValue(); // allowed values 0.1f-5.0f
light.ReflectorRange = m_spotRangeSlider.GetValue(); // allowed values 0.0f-MyLightsConstants.MAX_SPOTLIGHT_RANGE
light.ReflectorIntensity = prefabLight.ReflectorIntensityMax = m_spotIntensitySlider.GetValue(); // allowed values 0.0f-10.0f
light.ReflectorConeDegrees = m_spotAngleSlider.GetValue(); // allowed values 0.0f-MyLightsConstants.MAX_SPOTLIGHT_ANGLE
light.ShadowDistance = m_spotLightShadowDistance.GetValue();
prefabLight.FlashOffset = m_flashOffsetSlider.GetValue();
}
}