本文整理汇总了C#中HotSpotBase类的典型用法代码示例。如果您正苦于以下问题:C# HotSpotBase类的具体用法?C# HotSpotBase怎么用?C# HotSpotBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HotSpotBase类属于命名空间,在下文中一共展示了HotSpotBase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnHotSpotDrag
/// <summary>
/// Called while the user drags a hotspot that belongs to this shape
/// </summary>
/// <param name="hotSpot"></param>
/// <param name="view"></param>
/// <param name="fDeltaX"></param>
/// <param name="fDeltaY"></param>
public override void OnHotSpotDrag(HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
{
if (hotSpot == _hotSpotX)
Size = new Vector2F(_hotSpotX.CurrentDistance, Size.Y); // update for the view
if (hotSpot == _hotSpotY)
Size = new Vector2F(Size.X, _hotSpotY.CurrentDistance); // update for the view
if(hotSpot == _hotSpotXY)
{
float ratio = Size.Y / Size.X;
float newX = _hotSpotXY.CurrentDistance / (float)System.Math.Sqrt(ratio * ratio + 1.0f);
float newY = ratio * newX;
Size = new Vector2F(newX, newY);
}
}
开发者ID:romance-ii,项目名称:projectanarchy,代码行数:21,代码来源:MobileWaterShape.cs
示例2: OnHotSpotDrag
public override void OnHotSpotDrag(HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
{
base.OnHotSpotDrag(hotSpot, view, fDeltaX, fDeltaY);
// set on engine instance while dragging to see the effect
if (hotSpot == _hotSpotWindSpeed)
{
if (HasEngineInstance())
EnginePGroup.SetWindSpeed(_hotSpotWindSpeed.CurrentPosition, _bLocalSpaceWind);
}
else if (hotSpot == _hotSpotLightSamplingOffset)
{
if (HasEngineInstance())
EnginePGroup.SetLightSamplingOffset(_hotSpotLightSamplingOffset.CurrentPosition);
}
}
开发者ID:elemen,项目名称:projectanarchy,代码行数:16,代码来源:ParticleGroupShape.cs
示例3: OnHotSpotEvaluatePosition
public override void OnHotSpotEvaluatePosition(HotSpotBase hotSpot)
{
base.OnHotSpotEvaluatePosition(hotSpot);
if (hotSpot == _hotSpotWindSpeed)
{
hotSpot.Visible = ShowWindSpeedWidget;
if (!_hotSpotWindSpeed.IsDragging)
{
if (WindInLocalSpace)
_hotSpotWindSpeed.StartPosition = RotationMatrix * _windSpeed;
else
_hotSpotWindSpeed.StartPosition = _windSpeed;
}
}
else if (hotSpot == _hotSpotLightSamplingOffset)
{
hotSpot.Visible = ShowLightSamplingOffsetWidget;
if (!_hotSpotLightSamplingOffset.IsDragging)
_hotSpotLightSamplingOffset.StartPosition = _lightSamplingOffset;
}
}
开发者ID:elemen,项目名称:projectanarchy,代码行数:21,代码来源:ParticleGroupShape.cs
示例4: OnHotSpotDragEnd
/// <summary>
/// Called when the user releases the mouse button on a hotspot
/// </summary>
/// <param name="hotSpot"></param>
/// <param name="view"></param>
public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
{
if (hotSpot==_hotSpotSizeX)
{
if (_hotSpotSizeX.HasChanged)
{
float fNewSize = _hotSpotSizeX.CurrentDistance;
this.BoxSizeX = _hotSpotSizeX.StartDistance; // set old value for the action
EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this,"BoxSizeX",fNewSize)); // send an action which sets the property from old value to new one
}
}
if (hotSpot==_hotSpotSizeY)
{
if (_hotSpotSizeY.HasChanged)
{
float fNewSize = _hotSpotSizeY.CurrentDistance;
this.BoxSizeY = _hotSpotSizeY.StartDistance; // set old value for the action
EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this,"BoxSizeY",fNewSize)); // send an action which sets the property from old value to new one
}
}
if (hotSpot==_hotSpotSizeZ)
{
if (_hotSpotSizeZ.HasChanged)
{
float fNewSize = _hotSpotSizeZ.CurrentDistance;
this.BoxSizeZ = _hotSpotSizeZ.StartDistance; // set old value for the action
EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this,"BoxSizeZ",fNewSize)); // send an action which sets the property from old value to new one
}
}
}
开发者ID:romance-ii,项目名称:projectanarchy,代码行数:35,代码来源:TriggerBoxShape.cs
示例5: OnHotSpotRender
/// <summary>
/// Overridden function
/// </summary>
/// <param name="hotSpot"></param>
/// <param name="view"></param>
/// <param name="mode"></param>
public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
{
base.OnHotSpotRender (hotSpot, view, mode);
// render gravity as arrow
if (hotSpot==_hotSpotGravity)
{
view.RenderArrow(Position, _hotSpotGravity.Position, VisionColors.Yellow, 4.0f, 2.0f * EditorManager.Settings.GlobalUnitScaling);
}
}
开发者ID:bgarrels,项目名称:projectanarchy,代码行数:16,代码来源:ClothObjectShape.cs
示例6: OnHotSpotEvaluatePosition
/// <summary>
/// Called every frame and per hotspot that belongs to the shape
/// </summary>
/// <param name="hotSpot"></param>
public override void OnHotSpotEvaluatePosition(HotSpotBase hotSpot)
{
if (hotSpot==_hotSpotSizeX)
{
_hotSpotSizeX.Axis = this.XAxis;
_hotSpotSizeX.Visible = true;
if (!_hotSpotSizeX.IsDragging)
_hotSpotSizeX.StartDistance = this.SizeX;
}
if (hotSpot==_hotSpotSizeY)
{
_hotSpotSizeY.Axis = this.YAxis;
_hotSpotSizeY.Visible = true;
if (!_hotSpotSizeY.IsDragging)
_hotSpotSizeY.StartDistance = this.SizeY;
}
if (hotSpot==_hotSpotSizeZ)
{
_hotSpotSizeZ.Axis = this.ZAxis;
_hotSpotSizeZ.Visible = true;
if (!_hotSpotSizeZ.IsDragging)
_hotSpotSizeZ.StartDistance = this.SizeZ;
}
}
开发者ID:elemen,项目名称:projectanarchy,代码行数:28,代码来源:HeightFieldGeneratorShape.cs
示例7: OnHotSpotDrag
/// <summary>
/// Called while the user drags a hotspot that belongs to this shape
/// </summary>
/// <param name="hotSpot"></param>
/// <param name="view"></param>
/// <param name="fDeltaX"></param>
/// <param name="fDeltaY"></param>
public override void OnHotSpotDrag(HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
{
if (hotSpot==_hotSpotSizeX)
this.BoxSizeX = _hotSpotSizeX.CurrentDistance;
if (hotSpot==_hotSpotSizeY)
this.BoxSizeY = _hotSpotSizeY.CurrentDistance;
if (hotSpot==_hotSpotSizeZ)
this.BoxSizeZ = _hotSpotSizeZ.CurrentDistance;
}
开发者ID:romance-ii,项目名称:projectanarchy,代码行数:16,代码来源:TriggerBoxShape.cs
示例8: OnHotSpotEvaluatePosition
/// <summary>
/// Called every frame and per hotspot that belongs to the shape
/// </summary>
/// <param name="hotSpot"></param>
public override void OnHotSpotEvaluatePosition(HotSpotBase hotSpot)
{
#if (MESHGROUP_USE_LINKING)
if (hotSpot==_hotSpotSizeX)
{
_hotSpotSizeX.Axis = Vector3F.XAxis;
if (!_hotSpotSizeX.IsDragging)
_hotSpotSizeX.StartDistance = this.BoxSizeX;
}
if (hotSpot==_hotSpotSizeY)
{
_hotSpotSizeY.Axis = Vector3F.YAxis;
if (!_hotSpotSizeY.IsDragging)
_hotSpotSizeY.StartDistance = this.BoxSizeY;
}
if (hotSpot==_hotSpotSizeZ)
{
_hotSpotSizeZ.Axis = Vector3F.ZAxis;
if (!_hotSpotSizeZ.IsDragging)
_hotSpotSizeZ.StartDistance = this.BoxSizeZ;
}
#endif
}
开发者ID:hxzpily,项目名称:projectanarchy,代码行数:27,代码来源:StaticMeshGroupShape.cs
示例9: OnHotSpotDragEnd
public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
{
base.OnHotSpotDragEnd(hotSpot, view);
if (hotSpot == _hotSpotStartPoint)
{
Vector3F vNewPos = _hotSpotStartPoint.CurrentPosition + Position;
_vStartPoint = _hotSpotStartPoint.StartPosition; // set old value for the action
EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "StartPoint", vNewPos)); // send an action which sets the property from old value to new one
}
else if (hotSpot == _hotSpotEndPoint)
{
Vector3F vNewPos = _hotSpotEndPoint.CurrentPosition + Position;
_vEndPoint = _hotSpotEndPoint.StartPosition; // set old value for the action
EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "EndPoint", vNewPos)); // send an action which sets the property from old value to new one
}
}
开发者ID:RexBaribal,项目名称:projectanarchy,代码行数:16,代码来源:HavokNavMeshTestPathShape.cs
示例10: OnHotSpotDragBegin
/// <summary>
/// Called when user starts dragging a hotspot that belongs to this shape
/// </summary>
/// <param name="hotSpot"></param>
/// <param name="view"></param>
public override void OnHotSpotDragBegin(HotSpotBase hotSpot, VisionViewBase view)
{
#if (MESHGROUP_USE_LINKING)
if (hotSpot==_hotSpotSizeX)
_hotSpotSizeX.StartDistance = this.BoxSizeX;
if (hotSpot==_hotSpotSizeY)
_hotSpotSizeY.StartDistance = this.BoxSizeY;
if (hotSpot==_hotSpotSizeZ)
_hotSpotSizeZ.StartDistance = this.BoxSizeZ;
#endif
}
开发者ID:hxzpily,项目名称:projectanarchy,代码行数:16,代码来源:StaticMeshGroupShape.cs
示例11: OnHotSpotDrag
/// <summary>
/// Called while the user drags a hotspot that belongs to this shape
/// </summary>
/// <param name="hotSpot"></param>
/// <param name="view"></param>
/// <param name="fDeltaX"></param>
/// <param name="fDeltaY"></param>
public override void OnHotSpotDrag(HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
{
#if (MESHGROUP_USE_LINKING)
if (hotSpot==_hotSpotSizeX)
this.BoxSizeX = _hotSpotSizeX.CurrentDistance;
if (hotSpot==_hotSpotSizeY)
this.BoxSizeY = _hotSpotSizeY.CurrentDistance;
if (hotSpot==_hotSpotSizeZ)
this.BoxSizeZ = _hotSpotSizeZ.CurrentDistance;
#endif
}
开发者ID:hxzpily,项目名称:projectanarchy,代码行数:18,代码来源:StaticMeshGroupShape.cs
示例12: OnHotSpotEvaluatePosition
/// <summary>
/// Called every frame and per hotspot that belongs to the shape
/// </summary>
/// <param name="hotSpot"></param>
public override void OnHotSpotEvaluatePosition(HotSpotBase hotSpot)
{
if (hotSpot == _hotSpotX)
{
if (!_hotSpotX.IsDragging)
{
_hotSpotX.StartDistance = Size.X;
_hotSpotX.Axis = this.XAxis;
}
}
if (hotSpot == _hotSpotY)
{
if (!_hotSpotY.IsDragging)
{
_hotSpotY.StartDistance = Size.Y;
_hotSpotY.Axis = this.YAxis;
}
}
if (hotSpot == _hotSpotXY)
{
if (!_hotSpotXY.IsDragging)
{
_hotSpotXY.StartDistance = Size.GetLength();
Vector3F axis = (this.YAxis * Size.Y + this.XAxis * Size.X);
axis.Normalize();
_hotSpotXY.Axis = axis;
}
}
}
开发者ID:romance-ii,项目名称:projectanarchy,代码行数:35,代码来源:MobileWaterShape.cs
示例13: OnHotSpotDragEnd
/// <summary>
/// Called when the user releases the mouse button on a hotspot
/// </summary>
/// <param name="hotSpot"></param>
/// <param name="view"></param>
public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
{
if (hotSpot == _hotSpotX)
{
if (_hotSpotX.HasChanged)
{
float fNewX = _hotSpotX.CurrentDistance;
Size = new Vector2F(_hotSpotX.StartDistance, Size.Y); // set old value for the action
EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "Size", new Vector2F(fNewX, Size.Y))); // send an action which sets the property from old value to new one
}
}
if (hotSpot == _hotSpotY)
{
if (_hotSpotY.HasChanged)
{
float fNewY = _hotSpotY.CurrentDistance;
Size = new Vector2F(Size.X, _hotSpotY.StartDistance); // set old value for the action
EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "Size", new Vector2F(Size.X, fNewY))); // send an action which sets the property from old value to new one
}
}
if (hotSpot == _hotSpotXY)
{
if (_hotSpotXY.HasChanged)
{
float ratio = Size.Y / Size.X;
//compute old value
float oldX = _hotSpotXY.StartDistance / (float)System.Math.Sqrt(ratio * ratio + 1.0f);
float oldY = oldX * ratio;
Size = new Vector2F(oldX, oldY); // set old value for the action
//compute new value
float newX = _hotSpotXY.CurrentDistance / (float)System.Math.Sqrt(ratio * ratio + 1.0f);
float newY = ratio * newX;
EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "Size", new Vector2F(newX, newY))); // send an action which sets the property from old value to new one
}
}
}
开发者ID:romance-ii,项目名称:projectanarchy,代码行数:44,代码来源:MobileWaterShape.cs
示例14: OnHotSpotDragBegin
/// <summary>
/// Called when user starts dragging a hotspot that belongs to this shape
/// </summary>
/// <param name="hotSpot"></param>
/// <param name="view"></param>
public override void OnHotSpotDragBegin(HotSpotBase hotSpot, VisionViewBase view)
{
if (hotSpot == _hotSpotX)
_hotSpotX.StartDistance = Size.X;
if (hotSpot == _hotSpotY)
_hotSpotY.StartDistance = Size.Y;
if (hotSpot == _hotSpotXY)
_hotSpotXY.StartDistance = Size.GetLength();
}
开发者ID:romance-ii,项目名称:projectanarchy,代码行数:16,代码来源:MobileWaterShape.cs
示例15: OnHotSpotDragEnd
/// <summary>
/// Overridden hot spot handle function
/// </summary>
/// <param name="hotSpot"></param>
/// <param name="view"></param>
public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
{
base.OnHotSpotDragEnd (hotSpot, view);
if (hotSpot==_hotSpotLightGridOfs)
{
Vector3F vNewPos = _hotSpotLightGridOfs.CurrentPosition;
LightGridSampleOfs = _hotSpotLightGridOfs.StartPosition; // set old value for the action
EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this,"LightGridSampleOfs",vNewPos)); // send an action which sets the property from old value to new one
}
}
开发者ID:shuaiharry,项目名称:projectanarchy,代码行数:15,代码来源:EntityShape.cs
示例16: OnHotSpotEvaluatePosition
public override void OnHotSpotEvaluatePosition(HotSpotBase hotSpot)
{
base.OnHotSpotEvaluatePosition(hotSpot);
if (hotSpot == _hotSpotStartPoint && _hotSpotStartPoint.IsDragging)
{
StartPoint = _hotSpotStartPoint.CurrentPosition + Position;
}
else if (hotSpot == _hotSpotEndPoint && _hotSpotEndPoint.IsDragging)
{
EndPoint = _hotSpotEndPoint.CurrentPosition + Position;
}
}
开发者ID:RexBaribal,项目名称:projectanarchy,代码行数:12,代码来源:HavokNavMeshTestPathShape.cs
示例17: OnHotSpotEvaluatePosition
/// <summary>
/// Overridden hot spot handle function
/// </summary>
/// <param name="hotSpot"></param>
public override void OnHotSpotEvaluatePosition(HotSpotBase hotSpot)
{
base.OnHotSpotEvaluatePosition (hotSpot);
if (hotSpot==_hotSpotLightGridOfs)
{
_hotSpotLightGridOfs.Visible = this.ShowLightgridWidget;
if (_hotSpotLightGridOfs.IsDragging) // update while dragging
LightGridSampleOfs = _hotSpotLightGridOfs.CurrentPosition;
else
_hotSpotLightGridOfs.StartPosition = LightGridSampleOfs;
}
}
开发者ID:shuaiharry,项目名称:projectanarchy,代码行数:18,代码来源:EntityShape.cs
示例18: OnHotSpotRender
public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
{
base.OnHotSpotRender(hotSpot, view, mode);
view.RenderLine(_hotSpotStartPoint.CurrentPosition + Position, _hotSpotEndPoint.CurrentPosition + Position, VisionColors.Grey, 2.0f);
}
开发者ID:RexBaribal,项目名称:projectanarchy,代码行数:5,代码来源:HavokNavMeshTestPathShape.cs
示例19: OnHotSpotEvaluatePosition
public override void OnHotSpotEvaluatePosition(HotSpotBase hotSpot)
{
base.OnHotSpotEvaluatePosition(hotSpot);
if (hotSpot == _hotSpotWindSpeed)
{
if (!_hotSpotWindSpeed.IsDragging)
{
if (WindInLocalSpace)
_hotSpotWindSpeed.StartPosition = RotationMatrix * _windSpeed;
else
_hotSpotWindSpeed.StartPosition = _windSpeed;
}
}
}
开发者ID:hxzpily,项目名称:projectanarchy,代码行数:14,代码来源:ParticleGroupShape.cs
示例20: OnHotSpotDragEnd
/// <summary>
/// Called when the user releases the mouse button on a hotspot
/// </summary>
/// <param name="hotSpot"></param>
/// <param name="view"></param>
public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
{
if (hotSpot == _hotSpotAngle)
{
if (_hotSpotAngle.HasChanged)
{
float fNewAngle = _hotSpotAngle.CurrentAngle;
HotSpotAngleValue = _hotSpotAngle.StartAngle; // set old angle for the action
EditorManager.Actions.Add(new SetPropertyAction(this, "HotSpotAngleValue", fNewAngle)); // send an action which sets the property from old value to new one
}
}
}
开发者ID:hxzpily,项目名称:projectanarchy,代码行数:17,代码来源:HotSpotShape.cs
注:本文中的HotSpotBase类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论