在BP_SCharacter蓝图类中,给spawn actor from class 设置 owner(self)
在BP_SCharacter蓝图类中,给spawn actor from class 设置 owner(self)
当所有的感知都设置完毕但还是不起作用时,添加SightConfig->DetectionByAffiliation.bDetectNeutrals = true;
ProjectileMovementComponent类于火箭组件
当要使ProjectileMovementComponent朝某个目标前进,设置Homing
记得在AMiniCam::AMiniCam()构造函数里面加上PrimaryActorTick.bCanEverTick = true;
否则重写的Tick()函数不会执行,我自己折腾了半天突然想到了之前说的这个知识点。
选中后先按ctrl+K 再按ctrl+C 是注释
按住ctrl+K 再按ctrl+U是取消注释
hit碰撞事件,生成一个通道,贴画与材质碰撞,如果碰撞到,则生成贴画,否则就不生成
网络更新速率
NetUpdateFre qu en c y
1、解决方案、项目、程序集和命名空间:
解决方案:一个稍微复杂一点的软件,都需要很多模块来组成,为了体现彼此之间的层次关系,利于程序的复用,往往需要多个项目,每个项目实现不同的功能,最后将这些项目组合起来,就形成了一个完整的解决方案。形象地说,解决方案就是一个容器,在这个容器里,分成好多层,好多格,用来存放不同的项目。一个解决方案与项目是大于等于的关系。
项目:在.Net下,一个项目可以表现为多种类型,如控制台应用程序,Windows应用程序,类库(Class Library),Web应用程序,Web Service,Windows控件等等。
程序集:通俗的说,一个项目也就是一个程序集。一个程序集也可以体现为一个dll文件,或者exe文件。
命名空间:为了避免一个项目中,可能会存在的相同对象名的冲突。
2、锁死控制台窗口
cin.get();
While循环
while循环是循环结构的一种,可以通过while()括号中设定条件,该循环会在满足设定的条件时重复执行循环体内的函数。while循环的基本结构如下:
while(condition){
loop body;
}
其中condition表示条件,loop body表示循环体。
遍历一个数组的操作如下:
array<int,10> testArray;
int i = 0;
while(i < testArray.size()){
std::cout << testArray[i] << endl;
i++;
}
在场景加入 Wind Directional Source,风 来吹动布料
在Mesh中做操作
先右键创建布料
在菜单栏中点击 激活布料绘制
宏
定义宏的操作如下:
#define STR return 0;
可以指定一个字符串来代替另外的一些字符串。如:
#define END return 0;
#define FSTRING string
当定义了宏时,能够在使用被替换的字符串时键入宏名称来代替被替换的字符串。
在为一个数据类型定义一个宏或函数时,不能使用";"符号结束。
类型别名
用宏来实现类型别名外能够使用typedef来实现,操作如下:
typedef int UInt
需要使用";"符号结束。
typedef只能为数据类型定义别名。
do-while循环
do-while循环与while循环类似,区别在于do-while的函数体在条件判断语句的前面,所以无论条件满足与否,都会执行一次循环体。基本结构如下:
do{
loop body;
}while(condition);
其中,loop body表示循环体,condition表示条件。
使用do-while遍历数组的操作如下:
array<int, 10> testArray;
int i = 0;
do{
cout << testArray[i];
i++;
}while(i < testArray.size());
遍历数组的新方式
遍历数组的新方式操作如下:
array<int, 10> testArray;
for(int temp : testArray){
cout << temp << endl;
}
此方式只能够进行遍历操作,如果要使用此操作进行赋值,操作如下:
array<int, 10> testArray;
for(int& temp : testArray){
temp = 10;
}
需要SpaceScape制作星空的
多维数组
声明多维数组的基本结构如下:
int testArray[2][2]{
{11,22},
{33,44}
};
std::array<array<int, 2>,2> testArray2;
testArray2[0] = {{11,22}};
testArray2[1] = {{33,44}};
上述代码声明了一个2维数组testArray和testArray2,可以将第一个"[]"内的数字看做行数,第二个"[]"内的数字看做列数。
多维数组的声明和遍历操作如下:
#include <iostream>
#include <cstdio>
#include <string>
#include <array>
using namespace std;
int main()
{
array<int, 10> testArray{11,22,33,44,55,66,77,88,99,00};
array<int, 10> testArray2{22,33,44,55,66,77,88,99,00,11};
array<int, 10> testArray3{33,44,55,66,77,88,99,00,11,22};
array<array<int, 10>, 3> testArrayTotal;
testArrayTotal = { testArray, testArray2, testArray3 };
for (int i = 0; i < testArrayTotal.size();i++){
for (int j = 0; j < 10; j++){
cout << testArrayTotal[i][j] << "\n";
}
cout << "," << endl;
}
}
练习题
1.int i;
for(i = 0; i < 5; i++)
cout << i;
cout << endl;
这段代码将输出:
01234
2.int j;
for(j = 0; j < 11; j += 3)
cout << j;
cout << endl << j << endl;
这段代码将输出:
0369
12
3.int j = 5;
while(++j < 9)
cout << j++ << endl;
这段代码将输出:
6
8
4.int k = 8;
do
cout << "k = " << k << endl;
while(k++ < 5);
这段代码将输出:
k = 8;
5.
#include <iostream>
#include <cstdio>
#include <string>
#include <array>
using namespace std;
int main()
{
int result = 1;
for (int i = 0; i < 7; i++)
{
cout << result << " ";
result *= 2;
}
}
6.
#include <iostream>
#include <cstdio>
#include <string>
#include <array>
using namespace std;
int main()
{
int a = 0;
int b = 0;
int total = 0;
cout << "Enter a number:";
cin >> a;
cout << "Enter another number that larger than first one:";
cin >> b;
for (; a <= b; a++) {
total += a;
}
cout << "The sum of integers between two numbers is:" << total << endl;
}
7.
#include <iostream>
#include <cstdio>
#include <string>
#include <array>
using namespace std;
int main()
{
int temp = 0;
int sum = 0;
cout << "Enter a number(Enter zero mean quit program):";
cin >> temp;
while (temp != 0) {
sum += temp;
cout << "Current sum is:" << sum << endl;
cout << "Enter a number(Enter zero mean quit program):";
cin >> temp;
}
}
常量
常量是固定不变的量,如某个字符、数字或者true、false等。
常量的声明需要使用const限定符,如下:
const int i = 100;
常量一旦声明之后,就无法在其他代码段修改其值,必须转到声明行进行修改。
浮点型
浮点型是小数,分为单精度float和双精度double以及long double。float类型包含符号位1位、指数位8位和尾数位23;double类型包含符号位1位,指数位11位和尾数位52位;
C++中的科学计数法
可使用科学计数法表示浮点型数据,如1340000000可表示为1.34e+9。
e后面的符号表示小数点的左移或右移,如1.2e-6就等于0.0000012。
算数运算符
算数运算符有 +、-、*、/和%,分别为加、减、乘、除和取余(求模),用于数字类型数据的计算。
运算结果受赋值变量的数据类型的影响,如运算符两边的数据为浮点型,但接收结果的变量为整型,则结果不会采用四舍五入的方式取整,而是会向下取整,如下:
float a = 1.5;
float b = 2.3;
实际上a + b应该等于3.8,但如果接收结果的变量c为整型int时:
int c = a + b;
变量c的值为3.8向下取整的3。
关于取余运算符,在C++中,要求运算符两边的变量或常量均为整型数据。
关于优先级,与数学当中的优先级基本一致。
Predict Projectile Path By TraceChannel
TracePath
TraceComplex
GetForwardVector直接返回单位向量
MaxSimTime
DrawDebugType:ForOneFrame
TracePath打钩
1.BP_TraceVisualizer
TraceStartSphere
TraceEndSphere