VS多人调试
可以对不同的客户端或者服务器调试
VS多人调试
可以对不同的客户端或者服务器调试
修改了
StopMovement和destroyDecalComponet。点击鼠标后清除上一次点击的鼠标贴花并取消上一次的移动任务。课时8
打包与性能优化:
1、最低画质
2、是否开启前向渲染
3、分组(成组)
4、Start in VR
前后左右移动关注的Yaw旋转平面
GameFramework/CharacterMovementComponent.h
GameFramework/PlayerController.h
GameFramework/SpringArmComponent.h
Components/CapsuleComponent.h
Components/InputComponent.h
auto关键字
自动推断类型的关键字,它将会根据值来对变量设置数据类型。它不允许在声明变量时不设置默认值,必须在声明的同时为变量设置默认值。
auto关键字无法精确的指定变量的具体数据类型,所以默认值可能出现混淆时,就只能声明具体数据类型的变量。
练习题
1、让用户输入自己的身高(米),将它转换为厘米输出。
答:
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
float height = 0.0f;
cout << "Enter your height in meter:";
cin >> height;
cout << "Your height in centimeter is: " << height * 100.0f <<"cm" << endl;
}
2、编写一个程序,让用户输入秒数,将他转换为天-小时-分钟-秒并打印出来。
答:
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int second = 0;
cout << "Enter a second(integer):";
cin >> second;
//1h = 60m = 3600s 1d = 24h
cout << "The converted result is: "
<< second / 60 / 60 / 24<< "day(s), "
<< second / 3600 % 24<< "hour(s), "
<< second / 60 % 60<< "minute(s), "
<< second % 60<< "second(s)."<<endl;
}
3、要求用户输入一个班级的男生和女生的人数,输出女生的比例(百分比)。
答:
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int male = 0;
int female = 0;
cout << "Enter the count for male in the class:";
cin >> male;
cout << "Enter the count for female in the class:";
cin >> female;
cout << "The percentage of female in the class is:"
<< (float)female / (float)(female + male) * 100.0f
<< "%." << endl;
}
事件NotifyActorBeginOverllap必须设置属性
bGenerateOverlapEvents 为 true
在蓝图内进行设置,课里边没说
PickUpCube
捡起来就要关闭物理
换手:
StartClimb: 禁用重力,用模型位置
EndClimb 需要调用Movement
StopJumping
UpdateClimbLocation:
更新攀爬位置
子类函数重写
BP_ITraceInteractor交互
OnTraceHit
OnTraceLeave
OnTraceTriggerReleased
MotionController,HitResult作为参数
EMotionControllerInteractMode
Contact Mode:可以直接在场景中操作(接触式操作)
Trace Mode(非接触式操作)
Widget Mode
ActiveTraceInteractor: 启动远程交互
DeactiveTraceInteractor:关闭远程交互
TraceInteracting:开启远程追踪
射线交互
TraceArrow的WorldLocation和Forward Vector
LineTraceByChannel.
存储HitResult。
这里使用后了抛物线移动的更新SplineMesh的函数
Make Array。起点TraceStart和终点 Location(碰撞的点)直接更新成SplineMesh
当前碰撞到的Actor和FocusedActor做对比:
是否实现接口
Does Implement Interface?
BP_PhysicsCube:
OnTraceHit
OnTraceLeave
TraceTriggerReleased
碰到就SetRenderCustomDepth
release就给他AddImpulse
Tiling 平铺
vive做的不好,用的oculus
google的移动vr daydream
阿里的矢量图库
创建WidgetBlueprint文件
按钮OnClicked监听
在BP_MotionController中添加WidgetInteractor组件,与Widget交互
InteractionInstance 交互的距离。
Widget Interaction->PressPointerKey(模拟按键,可以使键盘或者鼠标)
WidgetInteraction ->ReleasePointerKey
松开按键
这俩事件都得调用,否则的会无法触发Click事件。
有ActivateWidgetInteract 激活
DeActiveWidgetInteract 非激活
WidgetInteract(在tick中调用)