本文整理汇总了C#中com.setAngle方法的典型用法代码示例。如果您正苦于以下问题:C# com.setAngle方法的具体用法?C# com.setAngle怎么用?C# com.setAngle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com
的用法示例。
在下文中一共展示了com.setAngle方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: resolve
public virtual void resolve(float x, float y, int chainLength, com.brashmonkey.spriter.objects.SpriterAbstractObject
effector)
{
float xx = effector.getX() + (float)System.Math.Cos(SpriterCalculator.DegreeToRadian(effector
.getAngle())) * SpriterCalculator.BONE_LENGTH * effector
.getScaleX();
float yy = effector.getY() + (float)System.Math.Sin(SpriterCalculator.DegreeToRadian(effector
.getAngle())) * SpriterCalculator.BONE_LENGTH * effector
.getScaleX();
effector.setAngle(com.brashmonkey.spriter.SpriterCalculator.angleBetween(effector
.getX(), effector.getY(), x, y));
if (this.player.getFlipX() == -1)
{
effector.setAngle(effector.getAngle() + 180f);
}
com.brashmonkey.spriter.objects.SpriterBone parent = null;
if (effector.hasParent())
{
parent = player.getRuntimeBones()[effector.getParentId()];
effector.copyValuesTo(temp);
com.brashmonkey.spriter.SpriterCalculator.reTranslateRelative(parent, temp);
if (effector is com.brashmonkey.spriter.objects.SpriterBone)
{
temp.copyValuesTo(player.lastFrame.getBones()[effector.getId()]);
}
else
{
temp.copyValuesTo(player.lastFrame.getObjects()[effector.getId()]);
}
}
for (int i = 0; i < chainLength && parent != null; i++)
{
if (com.brashmonkey.spriter.SpriterCalculator.distanceBetween(xx, yy, x, y) <= 1)
{
return;
}
parent.setAngle(parent.getAngle() + com.brashmonkey.spriter.SpriterCalculator.angleDifference
(com.brashmonkey.spriter.SpriterCalculator.angleBetween(parent.getX(), parent.getY
(), x, y), com.brashmonkey.spriter.SpriterCalculator.angleBetween(parent.getX(),
parent.getY(), xx, yy)));
this.player.updateRecursively(parent);
if (parent.hasParent())
{
parent = player.getRuntimeBones()[parent.getParent().getId()];
}
else
{
parent = null;
}
xx = effector.getX() + (float)System.Math.Cos(SpriterCalculator.DegreeToRadian(effector.getAngle
())) * SpriterCalculator.BONE_LENGTH * effector.getScaleX
();
yy = effector.getY() + (float)System.Math.Sin(SpriterCalculator.DegreeToRadian(effector.getAngle
())) * SpriterCalculator.BONE_LENGTH * effector.getScaleX
();
}
}
示例2: copyValuesTo
/// <summary>Sets the values of this instance to the given one.</summary>
/// <remarks>Sets the values of this instance to the given one.</remarks>
/// <param name="object">which has to be manipulated.</param>
public virtual void copyValuesTo(com.brashmonkey.spriter.objects.SpriterAbstractObject
@object)
{
@object.setAngle(angle);
@object.setScaleX(scaleX);
@object.setScaleY(scaleY);
@object.setX(x);
@object.setY(y);
@object.setId(id);
@object.setParentId(parentId);
@object.setParent(parent);
@object.setTimeline(timeline);
@object.setSpin(spin);
@object.setName(name);
}
示例3: interpolateAbstractObject
private void interpolateAbstractObject(com.brashmonkey.spriter.objects.SpriterAbstractObject
target, com.brashmonkey.spriter.objects.SpriterAbstractObject obj1, com.brashmonkey.spriter.objects.SpriterAbstractObject
obj2, float startTime, float endTime, float frame)
{
if (obj2 == null)
{
return;
}
target.setX(this.interpolate(obj1.getX(), obj2.getX(), startTime, endTime, frame)
);
target.setY(this.interpolate(obj1.getY(), obj2.getY(), startTime, endTime, frame)
);
target.setScaleX(this.interpolate(obj1.getScaleX(), obj2.getScaleX(), startTime,
endTime, frame));
target.setScaleY(this.interpolate(obj1.getScaleY(), obj2.getScaleY(), startTime,
endTime, frame));
target.setAngle(this.interpolateAngle(obj1.getAngle(), obj2.getAngle(), startTime
, endTime, frame));
}
示例4: modObject
private void modObject(com.brashmonkey.spriter.objects.SpriterAbstractObject @object
)
{
@object.setAngle(@object.getAngle() + this.angle);
@object.setScaleX(@object.getScaleX() * this.scaleX);
@object.setScaleY(@object.getScaleY() * this.scaleY);
@object.setX(@object.getX() + this.x);
@object.setY(@object.getY() + this.y);
}
示例5: reTranslateRelative
public static void reTranslateRelative(com.brashmonkey.spriter.objects.SpriterAbstractObject
parent, float x, float y, com.brashmonkey.spriter.objects.SpriterAbstractObject
target)
{
target.setAngle(target.getAngle() - parent.getAngle());
target.setScaleX(target.getScaleX() / parent.getScaleX());
target.setScaleY(target.getScaleY() / parent.getScaleY());
float xx = x - parent.getX();
float yy = y - parent.getY();
double angle = DegreeToRadian(parent.getAngle());
float cos = (float)System.Math.Cos(angle);
float sin = (float)System.Math.Sin(angle);
float newX = yy * sin + xx * cos;
float newY = yy * cos - xx * sin;
target.setX(newX / parent.getScaleX());
target.setY(newY / parent.getScaleY());
}
示例6: tweenBone
private void tweenBone(com.brashmonkey.spriter.objects.SpriterBone currentBone, com.brashmonkey.spriter.objects.SpriterBone
nextBone, int i, long startTime, long endTime)
{
currentBone.copyValuesTo(this.tempBones[i]);
this.tempBones[i].setTimeline((nextBone != null) ? currentBone.getTimeline() : -1
);
com.brashmonkey.spriter.objects.SpriterAbstractObject parent = (this.tempBones[i]
.hasParent()) ? this.tempBones[this.tempBones[i].getParentId()] : this.tempParent;
if (nextBone != null)
{
if (parent != this.tempParent)
{
if (!currentBone.getParent().equals(nextBone.getParent()))
{
nextBone = (com.brashmonkey.spriter.objects.SpriterBone)this.getTimelineObject(currentBone
, this.tempBones2);
com.brashmonkey.spriter.SpriterCalculator.reTranslateRelative(parent, nextBone);
nextBone.setAngle(nextBone.getAngle() * this.flippedX * this.flippedY);
}
}
else
{
if (nextBone.hasParent())
{
nextBone = (com.brashmonkey.spriter.objects.SpriterBone)this.getTimelineObject(currentBone
, this.tempBones2);
com.brashmonkey.spriter.SpriterCalculator.reTranslateRelative(parent, nextBone);
nextBone.setAngle(nextBone.getAngle() * this.flippedX * this.flippedY);
}
}
if (this.tempBones[i].tween)
{
this.interpolateAbstractObject(this.tempBones[i], currentBone, nextBone, startTime
, endTime);
}
}
this.moddedBones[currentBone.getId()].modSpriterBone(this.tempBones[i]);
if (this.transitionFixed)
{
this.tempBones[i].copyValuesTo(this.lastFrame.getBones()[i]);
}
else
{
this.tempBones[i].copyValuesTo(this.lastTempFrame.getBones()[i]);
}
if (!this.tempBones[i].hasParent() || !this.moddedBones[currentBone.getId()].isActive
())
{
this.tempBones[i].setX(this.tempBones[i].getX() + this.pivotX);
this.tempBones[i].setY(this.tempBones[i].getY() + this.pivotY);
}
this.translateRelative(this.tempBones[i], parent);
}
示例7: translateRelative
private void translateRelative(com.brashmonkey.spriter.objects.SpriterAbstractObject
@object, com.brashmonkey.spriter.objects.SpriterAbstractObject parent)
{
@object.setAngle(@object.getAngle() * this.flippedX * this.flippedY + parent.getAngle()
);
@object.setScaleX(@object.getScaleX() * parent.getScaleX());
@object.setScaleY(@object.getScaleY() * parent.getScaleY());
com.brashmonkey.spriter.SpriterCalculator.translateRelative(parent, @object);
}
示例8: tweenObject
private void tweenObject(com.brashmonkey.spriter.objects.SpriterObject currentObject
, com.brashmonkey.spriter.objects.SpriterObject nextObject, int i, long startTime
, long endTime)
{
com.brashmonkey.spriter.draw.DrawInstruction dI = this.instructions[i];
currentObject.copyValuesTo(this.tempObjects[i]);
com.brashmonkey.spriter.objects.SpriterAbstractObject parent = null;
if (!currentObject.isTransientObject())
{
this.tempObjects[i].setTimeline((nextObject != null) ? currentObject.getTimeline(
) : -1);
parent = (currentObject.hasParent()) ? this.tempBones[currentObject.getParentId()
] : this.tempParent;
if (nextObject != null)
{
if (parent != this.tempParent)
{
if (!currentObject.getParent().equals(nextObject.getParent()))
{
nextObject = (com.brashmonkey.spriter.objects.SpriterObject)this.getTimelineObject
(currentObject, this.tempObjects2);
com.brashmonkey.spriter.SpriterCalculator.reTranslateRelative(parent, nextObject);
nextObject.setAngle(nextObject.getAngle() * this.flippedX * this.flippedY);
}
}
else
{
if (nextObject.hasParent())
{
nextObject = (com.brashmonkey.spriter.objects.SpriterObject)this.getTimelineObject
(currentObject, this.tempObjects2);
com.brashmonkey.spriter.SpriterCalculator.reTranslateRelative(parent, nextObject);
nextObject.setAngle(nextObject.getAngle() * this.flippedX * this.flippedY);
}
}
if (this.tempObjects[i].tween)
{
this.interpolateSpriterObject(this.tempObjects[i], currentObject, nextObject, startTime
, endTime);
}
}
this.moddedObjects[currentObject.getId()].modSpriterObject(this.tempObjects[i]);
if (this.transitionFixed)
{
this.tempObjects[i].copyValuesTo(this.lastFrame.getObjects()[i]);
}
else
{
this.tempObjects[i].copyValuesTo(this.lastTempFrame.getObjects()[i]);
}
}
else
{
parent = this.tempParent;
}
if (!this.tempObjects[i].hasParent())
{
this.tempObjects[i].setX(this.tempObjects[i].getX() + this.pivotX);
this.tempObjects[i].setY(this.tempObjects[i].getY() + this.pivotY);
}
this.translateRelative(this.tempObjects[i], parent);
if (this.moddedObjects[currentObject.getId()].getRef() != null)
{
this.tempObjects[i].setRef(this.moddedObjects[currentObject.getId()].getRef());
}
/*if (this.moddedObjects[currentObject.getId()].getLoader() != null)
{
this.tempObjects[i].setLoader(this.moddedObjects[currentObject.getId()].getLoader
());
}*/
this.tempObjects[i].copyValuesTo(dI);
this.setInstructionRef(dI, this.tempObjects[i], nextObject);
}