本文整理汇总了C#中ShapeLink类的典型用法代码示例。如果您正苦于以下问题:C# ShapeLink类的具体用法?C# ShapeLink怎么用?C# ShapeLink使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ShapeLink类属于命名空间,在下文中一共展示了ShapeLink类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CanLink
public override bool CanLink(ShapeLink other)
{
if (!(other is AnchorLinkTarget))
return false;
// If we are already connected, accept the link (such calls may occur)
if (HasLinkTo(other))
return true;
// Do not allow more than two connections for a constraint link
// (a constraint accepts two anchors at maximum)
if (Links.Count >= 2)
return false;
return true;
}
开发者ID:shuaiharry,项目名称:projectanarchy,代码行数:16,代码来源:HavokConstraintLinkSource.cs
示例2: CanLink
/// <summary>
/// Check whether src can be linked to target. Either src or target has this shape as owner
/// </summary>
/// <param name="src">the link source</param>
/// <param name="target">the link target</param>
/// <returns></returns>
public override bool CanLink(ShapeLink src, ShapeLink target)
{
if (base.CanLink(src,target))
return true;
if (target.OwnerShape==this)
{
if (src is LinkSourceVisiblity)
return true;
}
return false;
}
开发者ID:elemen,项目名称:projectanarchy,代码行数:17,代码来源:MirrorShape.cs
示例3: SetLinkStatus
void SetLinkStatus(ShapeLink src, ShapeLink target, bool bStatus)
{
if (_engineInstance==null)
return;
// see if we can (un-)link to the custom sources/targets provided by the native entity class
IEngineInstanceObject3D targetInst = null;
int iLinkIndex = -1;
string otherName = null;
if (src.OwnerShape==this)
{
if (src is LinkSourceObject3D)
iLinkIndex = ((LinkSourceObject3D)src).iIndex;
else if (src is LinkBiDirectionalObject3D)
iLinkIndex = ((LinkBiDirectionalObject3D)src).iIndex;
targetInst = target.OwnerShape._engineInstance as IEngineInstanceObject3D;
otherName = target.PrimaryStringId;
}
else if (target.OwnerShape==this)
{
if (target is LinkTargetObject3D)
iLinkIndex = ((LinkTargetObject3D)target).iIndex;
else if (target is LinkBiDirectionalObject3D)
iLinkIndex = ((LinkBiDirectionalObject3D)target).iIndex;
targetInst = src.OwnerShape._engineInstance as IEngineInstanceObject3D;
otherName = src.PrimaryStringId;
}
if (iLinkIndex >= 0 && targetInst != null)
EngineEntity.OnLink(iLinkIndex, targetInst, otherName, bStatus);
}
开发者ID:shuaiharry,项目名称:projectanarchy,代码行数:31,代码来源:EntityShape.cs
示例4: OnUnlink
/// <summary>
/// Overridden function
/// </summary>
/// <param name="src"></param>
/// <param name="target"></param>
public override void OnUnlink(ShapeLink src, ShapeLink target)
{
base.OnUnlink(src, target); // handles trigger linking
SetLinkStatus(src, target, false);
}
开发者ID:shuaiharry,项目名称:projectanarchy,代码行数:10,代码来源:EntityShape.cs
示例5: CanLink
/// <summary>
/// Overridden function
/// </summary>
/// <param name="src"></param>
/// <param name="target"></param>
/// <returns></returns>
public override bool CanLink(ShapeLink src, ShapeLink target)
{
if (base.CanLink (src, target))
return true;
// see if we can link to the custom sources/targets provided by the native entity class
if (_engineInstance!=null)
{
IEngineInstanceObject3D targetInst = null;
int iLinkIndex = -1;
string otherName = null;
if (src.OwnerShape == this)
{
if (src is LinkSourceObject3D)
iLinkIndex = ((LinkSourceObject3D)src).iIndex;
else if (src is LinkBiDirectionalObject3D)
iLinkIndex = ((LinkBiDirectionalObject3D)src).iIndex;
targetInst = target.OwnerShape._engineInstance as IEngineInstanceObject3D;
otherName = target.PrimaryStringId;
}
else if (target.OwnerShape==this)
{
if (target is LinkTargetObject3D)
iLinkIndex = ((LinkTargetObject3D)target).iIndex;
else if (target is LinkBiDirectionalObject3D)
iLinkIndex = ((LinkBiDirectionalObject3D)target).iIndex;
targetInst = src.OwnerShape._engineInstance as IEngineInstanceObject3D;
otherName = src.PrimaryStringId;
}
if (iLinkIndex >= 0 && targetInst != null)
if (EngineEntity.CanLink(iLinkIndex, targetInst, otherName))
return true;
}
return false;
}
开发者ID:shuaiharry,项目名称:projectanarchy,代码行数:42,代码来源:EntityShape.cs
示例6: CanLink
/// <summary>
/// Check whether src can be linked to target. Either src or target has this shape as owner
/// </summary>
/// <param name="src">the link source</param>
/// <param name="target">the link target</param>
/// <returns>true, if the two can be linked</returns>
public override bool CanLink(ShapeLink src, ShapeLink target)
{
if (base.CanLink(src,target))
return true;
if (target.OwnerShape==this)
if (src is LinkSourceConstraint) return true;
return false;
}
开发者ID:elemen,项目名称:projectanarchy,代码行数:14,代码来源:ParticleGroupShape.cs
示例7: OnUnlink
/// <summary>
/// unlinks a target from a source. Either src or target has this shape as owner
/// </summary>
/// <param name="src">the link source</param>
/// <param name="target">the link target</param>
public override void OnUnlink(ShapeLink src, ShapeLink target)
{
base.OnUnlink(src, target);
// Ignore links which don't belong to us
if (src.OwnerShape != this)
return;
// Get the anchor the target link points to
AnchorShape anchorShape = GetAnchorFromLink(target);
if (anchorShape == null || !HasEngineInstance())
return;
bool bResult = EngineConstraintChainInstance.RemoveAnchor((long)anchorShape.UniqueID);
Debug.Assert(bResult == true);
}
开发者ID:shuaiharry,项目名称:projectanarchy,代码行数:21,代码来源:HavokConstraintChainShape.cs
示例8: OnUnlink
/// <summary>
/// Performs the unlinking
/// </summary>
/// <param name="src"></param>
/// <param name="target"></param>
public override void OnUnlink(ShapeLink src, ShapeLink target)
{
base.OnUnlink (src, target);
// forward the unlinking to the engine instance so that the native class can unlink from other native instances
if (src.OwnerShape==this && (target is BidirectionalNodeLink))
this.EngineNode.UnLinkNode((UIEngineInstanceDialog)target.OwnerShape._engineInstance);
if (target.OwnerShape==this && (src is BidirectionalNodeLink))
this.EngineNode.UnLinkNode((UIEngineInstanceDialog)src.OwnerShape._engineInstance);
}
开发者ID:taru00,项目名称:GUIEditor,代码行数:14,代码来源:DialogShape.cs
示例9: CanLink
public override bool CanLink(ShapeLink src, ShapeLink target)
{
if (target.OwnerShape == this && (target is LinkTargetPath))
return true;
return base.CanLink(src, target);
}
开发者ID:bgarrels,项目名称:projectanarchy,代码行数:6,代码来源:PathShape.cs
示例10: CanLink
/// <summary>
/// Check whether src can be linked to target. Either src or target has this shape as owner
/// </summary>
/// <param name="src">the link source</param>
/// <param name="target">the link target</param>
/// <returns></returns>
public override bool CanLink(ShapeLink src, ShapeLink target)
{
if (base.CanLink(src,target))
return true;
if (src.OwnerShape==this)
{
if (target is LinkTargetVisiblity)
return true;
if (target is LinkTargetObject3D) // allow for linking with custom entity links
return target.OwnerShape is EntityShape;
}
return false;
}
开发者ID:romance-ii,项目名称:projectanarchy,代码行数:19,代码来源:VisibilityObjectShape.cs
示例11: CanLink
/// <summary>
/// Inidcates whether a shape can be linked to this shape
/// </summary>
/// <param name="child">Shape instance to test</param>
/// <returns>true, if the shape can be linked</returns>
public override bool CanLink(ShapeLink src, ShapeLink target)
{
if (base.CanLink (src, target))
return true;
// check whether we are linking two nodes. The node can be a target or source.
// we always link in both directions node1 <-> node2
return (src is BidirectionalNodeLink) && (target is BidirectionalNodeLink);
}
开发者ID:taru00,项目名称:GUIEditor,代码行数:14,代码来源:DialogShape.cs
示例12: OnLink
public override void OnLink(ShapeLink src, ShapeLink target)
{
base.OnLink(src, target);
// additionally notify target...
if (src.OwnerShape == this)
{
target.OwnerShape.OnLink(src, target);
}
}
开发者ID:elemen,项目名称:projectanarchy,代码行数:10,代码来源:ConstraintShape.cs
示例13: CanLink
/// <summary>
/// Check whether src can be linked to target
/// </summary>
/// <param name="src"></param>
/// <param name="target"></param>
/// <returns></returns>
public override bool CanLink(ShapeLink src, ShapeLink target)
{
if (base.CanLink(src,target))
return true;
if (src.OwnerShape==this)
{
if (target is LinkTargetConstraint) return true;
}
return false;
}
开发者ID:elemen,项目名称:projectanarchy,代码行数:17,代码来源:ConstraintShape.cs
示例14: GetAnchorFromLink
/// <summary>
/// Gets the anchor which belongs to the passed link target
/// </summary>
/// <param name="linkTarget">link target</param>
/// <returns>anchor instance</returns>
private AnchorShape GetAnchorFromLink(ShapeLink linkTarget)
{
// Get the anchor shape which is connected to the passed link
AnchorShape anchorShape = linkTarget.OwnerShape as AnchorShape;
Debug.Assert(anchorShape != null);
return anchorShape;
}
开发者ID:shuaiharry,项目名称:projectanarchy,代码行数:13,代码来源:HavokConstraintChainShape.cs
示例15: OnUnlink
/// <summary>
/// unlinks a target from a source. Either src or target has this shape as owner
/// </summary>
/// <param name="src">the link source</param>
/// <param name="target">the link target</param>
public override void OnUnlink(ShapeLink src, ShapeLink target)
{
base.OnUnlink (src, target);
// perform the unlinking on the engine objects
if (target.OwnerShape==this)
{
VisibilityObjectShape visobjShape = src.OwnerShape as VisibilityObjectShape;
if (visobjShape!=null && visobjShape._engineInstance!=null) // at least the engine instance of the constraint can be null
EngineMirror.RemoveVisibilityObject(visobjShape._engineInstance as EngineInstanceVisibilityObject);
}
}
开发者ID:elemen,项目名称:projectanarchy,代码行数:16,代码来源:MirrorShape.cs
示例16: CanLink
/// <summary>
/// Check whether src can be linked to target. Either src or target has this shape as owner
/// </summary>
/// <param name="src">the link source</param>
/// <param name="target">the link target</param>
/// <returns></returns>
public override bool CanLink(ShapeLink src, ShapeLink target)
{
if (base.CanLink(src,target))
return true;
if (src.OwnerShape==this)
{
if (target is LinkTargetGroupStaticMeshes)
return true;
}
return false;
}
开发者ID:hxzpily,项目名称:projectanarchy,代码行数:17,代码来源:StaticMeshGroupShape.cs
示例17: OnUnlink
/// <summary>
/// unlinks a target from a source. Either src or target has this shape as owner
/// </summary>
/// <param name="src">the link source</param>
/// <param name="target">the link target</param>
public override void OnUnlink(ShapeLink src, ShapeLink target)
{
base.OnUnlink (src, target);
// perform the unlinking on the engine objects
if (target.OwnerShape==this)
{
ConstraintShape constraint = src.OwnerShape as ConstraintShape;
if (constraint != null && constraint._engineInstance != null && this.HasEngineInstance()) // at least the engine instance of the constraint can be null
EngineClothObj.RemoveConstraint(constraint._engineInstance as EngineInstanceConstraint);
}
}
开发者ID:bgarrels,项目名称:projectanarchy,代码行数:16,代码来源:ClothObjectShape.cs
示例18: OnLink
public override void OnLink(ShapeLink src, ShapeLink target)
{
base.OnLink(src, target);
_relevantShapes = null;
}
开发者ID:hxzpily,项目名称:projectanarchy,代码行数:5,代码来源:StaticMeshGroupShape.cs
示例19: OnLink
/// <summary>
/// Perform the actual linking. Either src or target has this shape as owner
/// </summary>
/// <param name="src">the link source</param>
/// <param name="target">the link target</param>
public override void OnLink(ShapeLink src, ShapeLink target)
{
base.OnLink (src, target); // adds to collections
if (HasEngineInstance())
EnginePGroup.OnLinksChanged();
// perform the linking on the engine objects
if (target.OwnerShape == this)
{
ConstraintShape constraint = src.OwnerShape as ConstraintShape;
if (constraint != null && HasEngineInstance() && constraint.HasEngineInstance()) // at least the engine instance of the constraint can be null
EnginePGroup.AddConstraint(constraint._engineInstance as EngineInstanceConstraint);
}
}
开发者ID:elemen,项目名称:projectanarchy,代码行数:20,代码来源:ParticleGroupShape.cs
示例20: OnLink
/// <summary>
/// Performs the actual linking on engine instances
/// </summary>
/// <param name="src"></param>
/// <param name="target"></param>
public override void OnLink(ShapeLink src, ShapeLink target)
{
base.OnLink(src, target);
// Ignore links which don't belong to us
if (src.OwnerShape != this)
return;
// Get the anchor the target link points to
AnchorShape anchorShape = GetAnchorFromLink(target);
if (anchorShape == null || !HasEngineInstance())
return;
// Get the entity instance the target points to
EngineInstanceEntity entityInstance = GetEntityFromAnchor(anchorShape);
// Add the actor to the constraint
if (entityInstance != null)
{
// We have an anchor which belongs to an entity. Add the entity to the constraint
// and pass the anchor position, relative to the parent entity.
Vector3F anchorPositionLS = anchorShape.LocalSpacePosition;
bool bResult = EngineConstraintChainInstance.AddEntityAnchor(
(long)anchorShape.UniqueID, entityInstance, anchorPositionLS);
Debug.Assert(bResult == true);
}
else
{
// Our anchor is statically attached to the world.
// Add the static world anchor to the constraint. Pass the world space position of the anchor
// for this purpose.
Vector3F anchorPositionWS = anchorShape.Position;
bool bResult = EngineConstraintChainInstance.AddWorldAnchor((long)anchorShape.UniqueID, anchorShape);
Debug.Assert(bResult == true);
}
}
开发者ID:shuaiharry,项目名称:projectanarchy,代码行数:41,代码来源:HavokConstraintChainShape.cs
注:本文中的ShapeLink类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论