UEC++ 探索虚幻5笔记 day11

news2024/9/29 11:28:28

虚幻5.2.1探索

项目目录探索

  • C++工程一定不能是中文路径,中文项目名,最好全部不要用中文,蓝图项目可以是中文
  • 浅浅创建一个空项目,讲解一下之前UE4没有讲解的项目目录文件的分布组成
    在这里插入图片描述
  • .vs:文件夹一般是项目编译缓存文件夹,
  • Binaries:存储虚幻引擎二进制的,针对不同平台发布的配置等
  • Config:虚幻的配置文件夹,一般里面都是虚幻的配置,或者自己写的配置
  • Content:内容文件夹,一般开发者后续创建的资产都在这里面
  • DerivedDataCache:虚幻生成与管理派生数据的文件夹,包含着色器的编译,编译材质贴图等等
  • Intermediate:存储一些模型缓存图片缓存等等,这个一般我们是不需要管理的,一般编译器出问题要删除C++代码时,这个文件也是要被删除的
  • Saved:包含配置文件,快照日志文件那些
  • Source:代码存放的位置
  • 一般我们写C++代码很容易导致编译器爆掉,我们除了要删除相对的代码或者是代码文件,还要删除.vs这个缓存文件夹,和这三个Binaries,Intermediate,项目名.sln文件文件,然后右键项目名.uproject文件,里面会有重新构建项目的选项,重新构建项目除错

虚幻C++常用结构

  • 虚幻引擎C++类层级结构(Hierarchy),与UE4一样一样,复习一下
    在这里插入图片描述
  • 反射与垃圾回收也是一样的,使用宏进行标识,UE的UHT系统会帮我们进行垃圾回收
    在这里插入图片描述

创建Actor类

  • 创建一个Actor类,当在创建Actor类时如果添加了文件,则代码里面会有这个添加了文件的头文件它会让编译器找不到Actor类,UE4好像没有这种情况,UE5就有,我们删除这个文件就可以了
    在这里插入图片描述
    在这里插入图片描述
  • 然后在UE5中vs中生成代码时,记得要关闭热重载,不然vs中的编译不会通过
    在这里插入图片描述

渐渐来个Hellow World

  • 给Actor来个Mesh,打印一下Hellow World通过日志打印与屏幕打印
  • 打印到屏幕要加头文件,#include "Engine/Engine.h"
  • 给Mesh硬编码加上材质与网格要加头文件,#include "UObject/ConstructorHelpers.h"
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Properties")
	class UStaticMeshComponent* StaticMesh;
//上面是.h中Public的内容-------------------------------------------------------------------------------------------------------

#include "MyActor_One.h"
#include "Engine/Engine.h"
#include "UObject/ConstructorHelpers.h"
#include "Components/StaticMeshComponent.h"

// Sets default values
AMyActor_One::AMyActor_One()
{
 	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;

	StaticMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("StaticMesh"));
	RootComponent = StaticMesh;
	
	//硬编码材质与网格
	ConstructorHelpers::FObjectFinder<UStaticMesh> StaticMeshAsset(TEXT("/Script/Engine.StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"));
	ConstructorHelpers::FObjectFinder<UMaterialInterface> MaterialAsset(TEXT("/Script/Engine.Material'/Engine/BasicShapes/BasicShapeMaterial.BasicShapeMaterial'"));
	if (StaticMeshAsset.Succeeded() && MaterialAsset.Succeeded())
	{
		StaticMesh->SetStaticMesh(StaticMeshAsset.Object);
		StaticMesh->SetMaterial(0, MaterialAsset.Object);
	}
}

// Called when the game starts or when spawned
void AMyActor_One::BeginPlay()
{
	Super::BeginPlay();

	UE_LOG(LogTemp, Warning, TEXT("Hello World"));
	UE_LOG(LogTemp, Warning, TEXT("Hello World"));
	UE_LOG(LogTemp, Error, TEXT("Hello World"));
	//这里的-1可以使用INDEX_NONE,INDEX_NONE也是-1,UE的宏
	GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Red, FString::Printf(TEXT("Hello World")));
	
}	
  • 运行结果
    在这里插入图片描述

宏的参数讲解

  • 变量的宏参数,UPROPERTY()
    • VisibleAnywhere:在蓝图中与视口中都可见
    • VisibleDefaultsOnly:只在蓝图中可见
    • VisibleInstanceOnly:只在视口中可见
    • EditAnywhere:在蓝图中与视口中都可编辑
    • EditDefultsOnly:在蓝图中可编辑
    • EditInstanceOnly:在视口中可编辑
    • BlueprintReadOnly:在蓝图中可读
    • BlueprintReadWrite:在蓝图中可读可写
    • Category:标签
    • meta = (MakeEditWidget = "true"):这是一个可选的元标记(Metadata),用于添加额外的属性信息。在这种情况下,MakeEditWidget 被设置为 “true”,这表示该属性可以在编辑器中作为一个小部件进行编辑。这通常用于自定义编辑器小部件以提供更直观的属性编辑体验。
    • meta=(ClampMin= -10,ClampMax= 10, UIMin= -10, UIMax= 10)):clamp:键盘输入值控制,ui:鼠标拉动值控制
    • meta = (AllowPrivateAccess = "true"):可以让内部的其他成员访问
  • 函数的宏参数:UFUNCTION()
    • BlueprintNativeEvent:BlueprintNativeEvent关键词允许在Unreal Engine蓝图中声明本地事件,并通过C++进行实现和扩展。在C++中实现一个蓝图本地事件时,需要在函数名后添加_Implementation作为后缀。这是为了区分虚函数和其实现函数,并保持代码的一致性和清晰度,总的来说就是会在C++中提供一个默认的实现,然后蓝图中去覆盖它改写它,在蓝图中实现这个函数时,如果调用一个父类的版本,它会先调用C++里面加了_Implementation这个函数,然后再去做蓝图其他的操作
    • BlueprintCallable:允许函数在蓝图中进行调用
    • BlueprintImplementableEvent:会把函数变成一个事件,把函数提升为事件后,就不能去初始化函数了,因为这个是在蓝图调用的事件
    • Category:标签

虚幻中的三维坐标

  • 在数学三维直角坐标系中里面XYZ也可以是,X:Roll,Y:Pitch,Z:Yaw,这是右手坐标系
  • 在UE中面XYZ也可以是,X:Pitch,Y:Yaw,Z:Roll,这是左手坐标系,UE中的
  • 在UE中XYZ轴的正向分别对应前方、右方和上方,显示的箭头颜色分别为红色、绿色和蓝色(三基色的习惯顺序)。
    在这里插入图片描述

虚幻5中的增强输入系统

  • UE5中已经摒弃掉了轴映射机制,改用为增强输入系统
  • UE5中没有默认开启增强输入系统,我们需要添加这个模块在项目名.Build.cs里面,这个完成后,最好是删除那几个文件重新构建一下避免一下后续的bug,项目目录探索那章
    在这里插入图片描述

定义绑定映射系统与处理函数

  • 增强输入系统的特定代码及定义一个映射绑定,一个移动轴的绑定,然后一个绑定的处理函数,这个处理函数要传入FInputActionValue的结构体要添加头文件#include "InputActionValue.h"在当前.h文件中
public:
	//映射绑定
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Input", meta = (AllPrivateAccess = "true"))
	class UInputMappingContext* DefaultMappingContext;

	//移动绑定
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Input", meta = (AllPrivateAccess = "true"))
	class UInputAction* MoveAction;

protected:
void CharacterMove(const FInputActionValue& value);
  • 这个处理函数基本就和之前写UE4时人物移动面向逻辑处理差不多
void AMyCharacter::CharacterMove(const FInputActionValue& value)
{
	FVector2D MovementVector = value.Get<FVector2D>();//获取速度
	if (Controller!=nullptr)
	{
		FRotator Rotation = Controller->GetControlRotation();
		FRotator YawRotation = FRotator(0, Rotation.Yaw, 0);
		//获取到前后单位向量
		FVector ForwardDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X);
		//获取左右单位向量
		FVector RightDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::Y);
		
		AddMovementInput(ForwardDirection, MovementVector.Y);
		AddMovementInput(RightDirection, MovementVector.X);
	}
}
  • 对比一下之前写的面向移动逻辑,这是之前UE4写的面向逻辑
    在这里插入图片描述
  • 那就来浅浅解释一下虚幻5中为什么这样写逻辑
    • 已知虚幻中的X:Pitch,Y:Yaw,Z:Roll

    • 我们获取到FInputActionValue这个结构体中的FVector2D,注意这里是FVector2D,这是数学平面坐标系
      FVector2D MovementVector = value.Get<FVector2D>();//获取速度
      在这里插入图片描述

    • 而在UE三维移动中,我们只需要关注Yaw(也就是Y)
      FRotator YawRotation = FRotator(0, Rotation.Yaw, 0);
      在这里插入图片描述

    • 然后在虚幻中默认为右方向以角色右手为正方向,所以那平面坐标系里面X是不是就是前后了,Y是左右
      FVector ForwardDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X);
      FVector RightDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::Y);
      在这里插入图片描述

    • 此时我们已经得到了前后左右的单位向量后,回到开始的逻辑因为UE5增强输入系统传入的是FInputActionValue结构体了,然后获取的是FVector2D这是个数学平面坐标系,所以添加到角色移动中,这里前后就是数学平面坐标系的Y了,左右就是X了
      AddMovementInput(ForwardDirection, MovementVector.Y);
      AddMovementInput(RightDirection, MovementVector.X);
      在这里插入图片描述

绑定移动

  • 在SetupPlayerInputComponen()中进行绑定移动,我们需要将PlayerInputComponent转换为UEnhancedInputComponent,然后进行绑定为了增强型输入系统,这里需要头文件#include "EnhancedInputComponent.h"来使用UEnhancedInputComponent组件
  • BindAction(MoveAction, ETriggerEvent::Triggered, this, &AMyCharacter::CharacterMove);
    • MoveAction:之前定义的移动绑定UInputAction
    • ETriggerEvent::Triggered:触发发生在一个或多个处理节拍之后,一般用Triggered比较多,其他不常用
    • this:自身来进行绑定
    • &AMyCharacter::CharacterMove:处理函数
// Called to bind functionality to input
void AMyCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
	Super::SetupPlayerInputComponent(PlayerInputComponent);

	UEnhancedInputComponent* EnhancedInputComponent = Cast<UEnhancedInputComponent>(PlayerInputComponent);
	if (EnhancedInputComponent)
	{
		//移动绑定
		EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AMyCharacter::CharacterMove);
	}
}

绑定映射

  • 在BeginPlay()中绑定增强输入系统的映射,首先将Controller转换为APlayerController,成功后使用UEnhancedInputLocalPlayerSubsystem将本地玩家使用增强型输入系统需要使用头文件:#include "EnhancedInputSubsystems.h",成功后就绑定映射
// Called when the game starts or when spawned
void AMyCharacter::BeginPlay()
{
	Super::BeginPlay();
	APlayerController* PlayerController = Cast<APlayerController>(Controller);
	if (PlayerController)
	{
		UEnhancedInputLocalPlayerSubsystem* Subsystem = 
			ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(PlayerController->GetLocalPlayer());
		if (Subsystem)
		{
			//映射到上下文
			Subsystem->AddMappingContext(DefaultMappingContext, 0);
		}
	}
}

编辑器操作

  • 创建一个输入操作蓝图与一个输入映射场景蓝图
    在这里插入图片描述
  • 将输入操作的值类型变更为Axis2D也就是Vector2D,因为我们角色是在平面上移动
    在这里插入图片描述
  • 在输入映射中添加映射,注意在虚幻中我们的轴默认是朝着右方向的,以角色的右手边为正方向,所以定义W向前的时候修改器要添加个拌合输入轴值,将右正方向旋转到向前的正方向
    在这里插入图片描述
  • S向后的修改器添加个拌合输入轴值,然后添加个否定(反向)
    在这里插入图片描述
  • D方向是朝右的,就不需要做任何修改
  • A方向就添加个否定即可
    在这里插入图片描述
  • 然后在角色蓝图中添加上增强输入系统
    在这里插入图片描述

视角移动绑定

  • 再添加一个UInputAction用来绑定视角,和视角处理函数
	//视角绑定
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Input", meta = (AllPrivateAccess = "true"))
	class UInputAction* LookAction;


void CharacterLook(const FInputActionValue& value);
  • 视角处理函数
void AMyCharacter::CharacterLook(const FInputActionValue& value)
{
	FVector2D LookAxisVector = value.Get<FVector2D>();
	if (Controller != nullptr)
	{
		AddControllerPitchInput(LookAxisVector.Y);
		AddControllerYawInput(LookAxisVector.X);
	}
}

// Called to bind functionality to input
void AMyCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
	Super::SetupPlayerInputComponent(PlayerInputComponent);

	UEnhancedInputComponent* EnhancedInputComponent = Cast<UEnhancedInputComponent>(PlayerInputComponent);
	if (EnhancedInputComponent)
	{
		//移动绑定
		EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AMyCharacter::CharacterMove);
		EnhancedInputComponent->BindAction(LookAction, ETriggerEvent::Triggered, this, &AMyCharacter::CharacterLook);
	}
}
  • 再建一个输入蓝图依然是FVector2D
    在这里插入图片描述
  • 添加到映射集合中,注意游戏中的视角是反向的,要修改为否定,只开启Y方向
    在这里插入图片描述

运行结果

请添加图片描述

限制上下视角范围

  • 限制角色上下视角范围和虚幻4中的写法差不多,只不过值变为了FInputActionValue结构体中的FVector2D 二维向量
void AMyCharacter::CharacterLook(const FInputActionValue& value)
{
	FVector2D LookAxisVector = value.Get<FVector2D>();
	if (Controller != nullptr)
	{
		GEngine->AddOnScreenDebugMessage(1, 10, FColor::Red, FString::Printf(TEXT("%f"),(GetControlRotation().Pitch)));
		AddControllerYawInput(LookAxisVector.X);
		if (GetControlRotation().Pitch < 270.f && GetControlRotation().Pitch>180.f && LookAxisVector.Y > 0.f)
		{
			return;
		}
		if (GetControlRotation().Pitch < 180.f && GetControlRotation().Pitch>45.f && LookAxisVector.Y < 0.f)
		{
			return;
		}
		AddControllerPitchInput(LookAxisVector.Y);
		
	}
}

MyCharacter.h

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "InputActionValue.h"
#include "MyCharacter.generated.h"

UCLASS()
class MYOBJECTUE5_API AMyCharacter : public ACharacter
{
	GENERATED_BODY()

public:
	// Sets default values for this character's properties
	AMyCharacter();

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Camera", meta = (AllPrivateAccess = "true"))
	class USpringArmComponent* SpringArm;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Camera", meta = (AllPrivateAccess = "true"))
	class UCameraComponent* MyCamera;

	//映射绑定
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Input", meta = (AllPrivateAccess = "true"))
	class UInputMappingContext* DefaultMappingContext;

	//移动绑定
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Input", meta = (AllPrivateAccess = "true"))
	class UInputAction* MoveAction;

	//视角绑定
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Input", meta = (AllPrivateAccess = "true"))
	class UInputAction* LookAction;

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

	void CharacterMove(const FInputActionValue& value);
	void CharacterLook(const FInputActionValue& value);

public:	
	// Called every frame
	virtual void Tick(float DeltaTime) override;

	// Called to bind functionality to input
	virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;

};

MyCharacter.cpp

// Fill out your copyright notice in the Description page of Project Settings.


#include "MyCharacter.h"
#include "Camera/CameraComponent.h"
#include "GameFramework/SpringArmComponent.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "EnhancedInputComponent.h"
#include "EnhancedInputSubsystems.h"
#include "Engine/Engine.h"
// Sets default values
AMyCharacter::AMyCharacter()
{
 	// Set this character to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;

	GetCharacterMovement()->bOrientRotationToMovement = true;
	GetCharacterMovement()->RotationRate = FRotator(0.f, 500.f, 0.f);
	GetCharacterMovement()->MaxWalkSpeed = 500.f;
	GetCharacterMovement()->MinAnalogWalkSpeed = 20.f;
	GetCharacterMovement()->BrakingDecelerationWalking = 2000.f;


	//相机臂
	SpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("SpringArm"));
	SpringArm->SetupAttachment(GetRootComponent());
	SpringArm->TargetArmLength = 400.f;
	SpringArm->bUsePawnControlRotation = true;

	//相机
	MyCamera = CreateDefaultSubobject<UCameraComponent>(TEXT("MyCamera"));
	MyCamera->SetupAttachment(SpringArm, USpringArmComponent::SocketName);//附加到末尾
	MyCamera->bUsePawnControlRotation = false;
}

// Called when the game starts or when spawned
void AMyCharacter::BeginPlay()
{
	Super::BeginPlay();
	APlayerController* PlayerController = Cast<APlayerController>(Controller);
	if (PlayerController)
	{
		UEnhancedInputLocalPlayerSubsystem* Subsystem = 
			ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(PlayerController->GetLocalPlayer());
		if (Subsystem)
		{
			//映射到上下文
			Subsystem->AddMappingContext(DefaultMappingContext, 0);
		}
	}
}

void AMyCharacter::CharacterMove(const FInputActionValue& value)
{
	FVector2D MovementVector = value.Get<FVector2D>();//获取速度
	if (Controller!=nullptr)
	{
		FRotator Rotation = Controller->GetControlRotation();
		FRotator YawRotation = FRotator(0, Rotation.Yaw, 0);
		//获取到前后单位向量
		FVector ForwardDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X);
		//获取左右单位向量
		FVector RightDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::Y);
		
		AddMovementInput(ForwardDirection, MovementVector.Y);
		AddMovementInput(RightDirection, MovementVector.X);
	}
}

void AMyCharacter::CharacterLook(const FInputActionValue& value)
{
	FVector2D LookAxisVector = value.Get<FVector2D>();
	if (Controller != nullptr)
	{
		GEngine->AddOnScreenDebugMessage(1, 10, FColor::Red, FString::Printf(TEXT("%f"),(GetControlRotation().Pitch)));
		AddControllerYawInput(LookAxisVector.X);
		if (GetControlRotation().Pitch < 270.f && GetControlRotation().Pitch>180.f && LookAxisVector.Y > 0.f)
		{
			return;
		}
		if (GetControlRotation().Pitch < 180.f && GetControlRotation().Pitch>45.f && LookAxisVector.Y < 0.f)
		{
			return;
		}
		AddControllerPitchInput(LookAxisVector.Y);
		
	}
}

// Called every frame
void AMyCharacter::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

}

// Called to bind functionality to input
void AMyCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
	Super::SetupPlayerInputComponent(PlayerInputComponent);

	UEnhancedInputComponent* EnhancedInputComponent = Cast<UEnhancedInputComponent>(PlayerInputComponent);
	if (EnhancedInputComponent)
	{
		//移动绑定
		EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AMyCharacter::CharacterMove);
		EnhancedInputComponent->BindAction(LookAction, ETriggerEvent::Triggered, this, &AMyCharacter::CharacterLook);
	}
}


本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1283795.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Deployment脚本部署Tomcat集群:外部访问、负载均衡、文件共享及集群配置调整

文章目录 前置知识一、Deployment脚本部署Tomcat集群二、外部访问Tomcat集群三、利用Rinted对外提供Service负载均衡支持1、创建服务2、端口转发工具Rinetd3、定义jsp文件查看转发到哪个节点 四、部署配置挂载点五、基于NFS实现集群文件共享1、master2、node3、验证 六、集群配…

ESP32-Web-Server编程-通过 Web 下载文本

ESP32-Web-Server编程-通过 Web 下载文本 概述 当你希望通过网页导出设备的数据时&#xff0c;可以在 ESP32 上部署一个简单的文件 Web 服务器。 需求及功能解析 本节演示如何在 ESP32 上部署一个最简单的 Web 服务器&#xff0c;来接收浏览器或者 wget 指令请求文件数据。…

Course2-Week2-神经网络的训练方法

Course2-Week2-神经网络的训练方法 文章目录 Course2-Week2-神经网络的训练方法1. 神经网络的编译和训练1.1 TensorFlow实现1.2 损失函数和代价函数的数学公式 2. 其他的激活函数2.1 Sigmoid激活函数的替代方案2.2 如何选择激活函数2.3 为什么需要激活函数 3. 多分类问题和Soft…

时间序列数据压缩算法简述

本文简单介绍了时间序列压缩任务的来源&#xff0c;压缩算法的分类&#xff0c;并对常见压缩算法的优缺点进行了简介&#xff0c;爱码士们快来一探究竟呀&#xff01; 引言 时间序列数据是在许多应用程序和领域中生成的一种基本数据类型&#xff0c;例如金融、医疗保健、交通和…

智能优化算法应用:基于阿基米德优化算法无线传感器网络(WSN)覆盖优化 - 附代码

智能优化算法应用&#xff1a;基于阿基米德优化算法无线传感器网络(WSN)覆盖优化 - 附代码 文章目录 智能优化算法应用&#xff1a;基于阿基米德优化算法无线传感器网络(WSN)覆盖优化 - 附代码1.无线传感网络节点模型2.覆盖数学模型及分析3.阿基米德优化算法4.实验参数设定5.算…

4.grid_sample理解与使用

pytorch中的grid_sample 文章目录 pytorch中的grid_samplegrid_samplegrid_sample函数原型实例 欢迎访问个人网络日志&#x1f339;&#x1f339;知行空间&#x1f339;&#x1f339; grid_sample 直译为网格采样&#xff0c;给定一个mask patch&#xff0c;根据在目标图像上的…

抖音集团面试挂在2面,复盘后,决定二战.....

先说下我基本情况&#xff0c;本科不是计算机专业&#xff0c;现在是学通信&#xff0c;然后做图像处理&#xff0c;可能面试官看我不是科班出身没有问太多计算机相关的问题&#xff0c;因为第一次找工作&#xff0c;字节的游戏专场又是最早开始的&#xff0c;就投递了&#xf…

GEE——利用多源遥感数据和SVM方法进行不同时期(多时相)遥感影像的分类

简介: 本教程主要的目的是实现多起遥感影像的分类,这里使用两景应先给,融合了多波段影像,其次还包含去除水域和根据NDSI指数去除雪的部分。我们分别利用不同时期的影像进行分析分别分类,这里利用的是提取样本点,然后进行SVM分布。 数据集 这里我们使用的数据集: NASA…

ODN光纤链路全程衰减如何计算

在FTTH等宽带光纤接入工程设计中&#xff0c;需根据应用系统的相应波长计算ODN光纤链路的全程衰减&#xff0c;一方面验证是否满足系统的光功率预算指标要求&#xff0c;另一方面作为工程验收的参考指标。 1 计算方法 ODN光纤链路的全程衰减是指从OLT至ONU的光纤链路中&#xf…

Learning Normal Dynamics in Videos with Meta Prototype Network 论文阅读

文章信息&#xff1a;发表在cvpr2021 原文链接&#xff1a; Learning Normal Dynamics in Videos with Meta Prototype Network 摘要1.介绍2.相关工作3.方法3.1. Dynamic Prototype Unit3.2. 视频异常检测的目标函数3.3. 少样本视频异常检测中的元学习 4.实验5.总结代码复现&a…

C#网络编程UDP程序设计(UdpClient类)

目录 一、UdpClient类 二、示例 1.源码 &#xff08;1&#xff09;Client &#xff08;2&#xff09;Server 2.生成 &#xff08;1&#xff09;先启动服务器&#xff0c;发送广播信息 &#xff08;2&#xff09;再开启客户端接听 UDP是user datagram protocol的简称&a…

Star 10.4k!推荐一款国产跨平台、轻量级的文本编辑器,内置代码对比功能

notepad 相信大家从学习这一行就开始用了&#xff0c;它是开发者/互联网行业的上班族使用率最高的一款轻量级文本编辑器。但是它只能在Windows上进行使用&#xff0c;而且正常来说是收费的&#xff08;虽然用的是pj的&#xff09;。 对于想在MacOS、Linux上想使用&#xff0c;…

EM32DX-C2【C#】

1说明&#xff1a; 分布式io&#xff0c;CAN总线&#xff0c;C#上位机二次开发&#xff08;usb转CAN模块&#xff09; 2DI&#xff1a; 公共端是&#xff1a; 0V【GND】 X0~X15&#xff1a;自带24v 寄存器地址&#xff1a;0x6100-01 6100H DI输入寄存器 16-bit &#x…

鸿蒙系统扫盲(四):鸿蒙使用的是微内核?

我们常说&#xff0c;看一个系统是不是自研&#xff0c;就看它的内核&#xff0c;常见的内核分为&#xff1a;宏内核和微内核&#xff0c;当然还有两者结合体&#xff0c;他们到底有什么区别&#xff1f; 1.白话宏内核和微内核 有一天&#xff0c;你结婚了&#xff0c;你和你…

安全测试之推荐工具(一)

文章目录 一、前言二、Web安全&#xff08;一&#xff09;AppScan&#xff08;推荐&#xff09;&#xff08;二&#xff09;AWVS&#xff08;推荐&#xff09;&#xff08;三&#xff09;Burp Suite&#xff08;推荐&#xff09;&#xff08;四&#xff09;OWASP ZAP 三、主机安…

电子取证--windows下的volatility分析与讲解

1.volatility的安装 提示&#xff1a;我用的是2.6版本&#xff08;windows&#xff09;&#xff0c;如果直接下载的出现问题&#xff0c;用迅雷就可以解决 下载地址&#xff1a;Volatility 2.volatility的使用 1.进入终端&#xff0c;查看镜像的系统信息&#xff1a; volati…

[ROS2] --- ROS diff ROS2

1 ROS存在的问题 一旦Ros Master主节点挂掉后&#xff0c;就会造成整个系统通信的异常,通信基于TCP实现&#xff0c;实时性差、系统开销大对Python3支持不友好&#xff0c;需要重新编译消息机制不兼容没有加密机制、安全性不高 2 ROS and ROS2架构对比 ROS和ROS2架构如下图所…

实体、协议、服务和服务访问点

目录 一、概念 二、相邻两层之间的关系 三、面向连接服务的特点 四、无连接服务的特点 五、著名的协议举例 一、概念 实体&#xff08;entity&#xff09;表示任何可发送或接收信息的硬件或软件进程。同机器上同一层的实体叫做对等实体&#xff08;peer entity&#xff0…

如何创建maven项目的多模块项目

Maven多模块项目是指一个Maven项目中包含多个子模块&#xff0c;每个子模块又是一个独立的Maven项目&#xff0c;但它们之间可以存在依赖关系。Maven多模块项目可以方便地管理多个子模块的依赖和构建过程&#xff0c;同时也可以提高项目的可维护性和可扩展性。创建maven项目的父…

RH850P1X芯片学习笔记-Pin Functions

文章目录 Pin Connection Diagrams术语定义 Pin ListPort OverviewIntroductionFunctional OverviewPort CategoryOperation Mode运行模式 Port Function寄存器地址映射 Port寄存器描述Pn/JP0 — Port RegisterPPRn/JPPR0 — Port Pin Read RegisterPMn/JPM0 — Port Mode Regi…