本文整理匯總了Java中com.flowpowered.math.vector.Vector3d.mul方法的典型用法代碼示例。如果您正苦於以下問題:Java Vector3d.mul方法的具體用法?Java Vector3d.mul怎麽用?Java Vector3d.mul使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.flowpowered.math.vector.Vector3d
的用法示例。
在下文中一共展示了Vector3d.mul方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getModelTranslation
import com.flowpowered.math.vector.Vector3d; //導入方法依賴的package包/類
public Vector3d getModelTranslation() {
// The texture must have a 1;1 aspect ratio, so it is expanded
Vector2d uvRegionSize = getUvRegionSize();
Vector2d result2d = Vector2d.ZERO;
// First, align with the upper left corner of the inventory slot
result2d = result2d.add(uvRegionSize);
result2d = result2d.sub(Vector2d.from(INVENTORY_TEXTURE_SLOT_SIZE));
result2d = result2d.div(2);
// Apply custom offset
Vector3d result3d = result2d.toVector3().add(this.textureOffset);
// Finally, flip the Y coordinate, because it's inverse in minecraft
result3d = result3d.mul(1, -1, 1);
return result3d;
}