本文整理汇总了C++中PlayerSAO::getRadLookPitchDep方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerSAO::getRadLookPitchDep方法的具体用法?C++ PlayerSAO::getRadLookPitchDep怎么用?C++ PlayerSAO::getRadLookPitchDep使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerSAO
的用法示例。
在下文中一共展示了PlayerSAO::getRadLookPitchDep方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: l_get_look_pitch
// DEPRECATED
// get_look_pitch(self)
int ObjectRef::l_get_look_pitch(lua_State *L)
{
NO_MAP_LOCK_REQUIRED;
log_deprecated(L,
"Deprecated call to get_look_pitch, use get_look_vertical instead");
ObjectRef *ref = checkobject(L, 1);
PlayerSAO* co = getplayersao(ref);
if (co == NULL) return 0;
// Do it
lua_pushnumber(L, co->getRadLookPitchDep());
return 1;
}
示例2: l_get_look_dir
// get_look_dir(self)
int ObjectRef::l_get_look_dir(lua_State *L)
{
NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
PlayerSAO* co = getplayersao(ref);
if (co == NULL) return 0;
// Do it
float pitch = co->getRadLookPitchDep();
float yaw = co->getRadYawDep();
v3f v(std::cos(pitch) * std::cos(yaw), std::sin(pitch), std::cos(pitch) *
std::sin(yaw));
push_v3f(L, v);
return 1;
}