本文整理汇总了C#中SceneNode.GetAttachedObject方法的典型用法代码示例。如果您正苦于以下问题:C# SceneNode.GetAttachedObject方法的具体用法?C# SceneNode.GetAttachedObject怎么用?C# SceneNode.GetAttachedObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SceneNode
的用法示例。
在下文中一共展示了SceneNode.GetAttachedObject方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddRemoveState
/// <summary>
/// 将当前结点状态与之同步
/// operateflag说明
/// 1增加结点
/// 2删除结点
/// 3更新位置和缩放,旋转
/// </summary>
/// <param name="node"></param>
/// <param name="operateflat"></param>
public ModelEntryStruct AddRemoveState(SceneNode node, int operateflag)
{
if (node == null)
return null;
switch (operateflag)
{
case 1://增加操作
{
ModelEntryStruct modelentry = new ModelEntryStruct();
Entity en = node.GetAttachedObject(0) as Entity;
if (en != null)
{
//得到模型的相关信息,
modelentry.模型名 = en.GetMesh().Name;
modelentry.材质 = "";
modelentry.实体名 = en.Name;
modelentry.缩放比例 = node.GetScale();
modelentry.位置 = node.Position;
modelentry.旋转角度 = new Vector3();
modelEntry.模型链表.Add(modelentry);
//modelentry.名称 = MainOgreForm.GetDateName();
//更新树节点
if (this.AddNode != null)
this.AddNode(modelentry);
//MainOgreForm.Singleton.AddNodeTree(modelentry);
return modelentry;
}
}
break;
case 2://删除
{
Entity en = node.GetAttachedObject(0) as Entity;
if (en == null)
return null;
for (int i = 0; i < modelEntry.模型链表.Count; i++)
{
if (modelEntry.模型链表[i].实体名 == en.Name)
{
if (this.RemoveNode != null)
this.RemoveNode(modelEntry.模型链表[i]);
//MainOgreForm.Singleton.RemoveNodeTree(modelEntry.模型链表[i]);
modelEntry.模型链表.RemoveAt(i);
break;
}
}
}
break;
default:
break;
}
return null;
}
示例2: GetModelEntry
public ModelEntryStruct GetModelEntry(SceneNode node)
{
Entity en = node.GetAttachedObject(0) as Entity;
if (en != null)
{
foreach (ModelEntryStruct men in 模型链表)
{
if (men.实体名 == en.Name)
{
return men;
}
}
}
return null;
}
示例3: RemoveAndDestroyLife
/// <summary>
/// This method remove from the 3D overlay and destries the passed scene node
/// </summary>
/// <param name="life"></param>
private void RemoveAndDestroyLife(SceneNode life)
{
overlay3D.Remove3D(life);
lives.Remove(life);
MovableObject heart = life.GetAttachedObject(0);
life.DetachAllObjects();
life.Dispose();
heart.Dispose();
}
示例4: UpdateModelState
/// <summary>
/// 更新模型位置大小,选择状态
/// </summary>
/// <param name="node">所需更新的节点</param>
/// <param name="q">节点饶那个轴旋转旋转,只能更新一个角度的旋转,如“x,y,z”</param>
/// <param name="angle">旋转的角度</param>
public void UpdateModelState(SceneNode node, char q, float angle)
{
Entity en = node.GetAttachedObject(0) as Entity;
for (int i = 0; i < modelEntry.模型链表.Count; i++)
{
if (modelEntry.模型链表[i].实体名 == en.Name)
{
ModelEntryStruct modelentry = modelEntry.模型链表[i];
modelentry.缩放比例 = node.GetScale();
modelentry.位置 = node.Position;
//更新旋转角度
if (q.Equals('x'))
{
modelentry.旋转角度.x = angle;
}
else if (q.Equals('y'))
{
modelentry.旋转角度.y = angle;
}
else if (q.Equals('z'))
{
modelentry.旋转角度.z = angle;
}
break;
}
}
}
示例5: UpdateBillState
public void UpdateBillState(SceneNode node)
{
BillboardSet en = node.GetAttachedObject(0) as BillboardSet;
for (int i = 0; i < modelEntry.广告牌.Count; i++)
{
if (modelEntry.广告牌[i].实体名 == en.Name)
{
BillBoardstruct modelentry = modelEntry.广告牌[i];
modelentry.位置 = node.Position;
break;
}
}
}
示例6: RemoveBill
public void RemoveBill(SceneNode node)
{
if (node == null)
return;
BillboardSet en = node.GetAttachedObject(0) as BillboardSet;
if (en == null)
return;
for (int i = 0; i < modelEntry.广告牌.Count; i++)
{
if (modelEntry.广告牌[i].实体名 == en.Name)
{
modelEntry.广告牌.RemoveAt(i);
break;
}
}
}