Skip to content

Instantly share code, notes, and snippets.

View whoo24's full-sized avatar

Wooyeong Choe whoo24

  • Oslo, Norway
View GitHub Profile
@whoo24
whoo24 / reopen.ps1
Created June 15, 2020 07:34
p4-reopen under root folder
Get-ChildItem c:\wooyeongc-dev\Plugins\Mercuna -Recurse -Force |
ForEach-Object -Process {
p4 reopen -c default "$($PSItem.FullName)"
}
@whoo24
whoo24 / CircularSector.cpp
Last active June 4, 2019 16:46
Circular sector for UE4
FCircularSector::FCircularSector() {}
FCircularSector::FCircularSector(const FVector& Center, float YawAngle, float ConeHalfAngle, float Near, float Far)
: m_Center(Center), m_Yaw(YawAngle), m_HalfAngle(ConeHalfAngle), m_Near(Near), m_Far(Far)
{
}
bool FCircularSector::Contains(const FVector& Location) const
{
return CheckToContain(m_Near, m_Far, Location - m_Center, m_HalfAngle, m_Yaw);
@whoo24
whoo24 / GetActorPosInScreenSpace.cpp
Created May 28, 2019 16:37
Get Actor Position in Screen space in UE4
bool GetActorPosInScreenSpace(const APlayerController* Player, const AActor& Actor, FVector2D& OutScreenPos)
{
FVector WorldPosition = Actor->GetActorLocation();
ULocalPlayer* const LP = Player ? Player->GetLocalPlayer() : nullptr;
if (LP && LP->ViewportClient)
{
// get the projection data
FSceneViewProjectionData ProjectionData;
if (LP->GetProjectionData(LP->ViewportClient->Viewport, eSSP_FULL, /*out*/ ProjectionData))
{
@whoo24
whoo24 / IsInFrustum.cpp
Last active May 28, 2019 16:35
Is an actor in frustum in UE4?
bool IsInFrustum(AActor* Actor)
{
ULocalPlayer* LocalPlayer = Actor->GetWorld()->GetFirstLocalPlayerFromController();
if (LocalPlayer != nullptr && LocalPlayer->ViewportClient != nullptr && LocalPlayer->ViewportClient->Viewport)
{
FSceneViewFamilyContext ViewFamily(FSceneViewFamily::ConstructionValues(
LocalPlayer->ViewportClient->Viewport,
Actor->GetWorld()->Scene,
LocalPlayer->ViewportClient->EngineShowFlags)
@whoo24
whoo24 / Get-Sdl2.ps1
Created October 5, 2018 01:45
Downloading sdl2 dev libs using powershell
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-WebRequest -Uri 'https://libsdl.org/release/SDL2-devel-2.0.8-VC.zip' -OutFile '.\SDL2-devel-2.0.8-VC.zip'
// Algorism = not 'Algorithm'
/*
1 < N < 100,000
예)
입력 : abaccchhaa
결과 : b1a1c3h2a3
*/
#include "stdafx.h"
@whoo24
whoo24 / Program.cs
Created June 22, 2017 04:14
Prime Factoring
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PrimeFactoring {
class Program {
static void Main (string[] args) {
while (true) {
Solve(int.Parse(Console.ReadLine()));
$BaseDir = ""
$TargetDirName = "Tmp"
Get-ChildItem $BaseDir -Include $TargetDirName -Recurse | ForEach ($_) { Remove-Item $_.fullname -Force -Recurse }
$TargetDir = ""
$TargetFile = "*.txt"
Get-ChildItem $TargetDir -Include $TargetFile -Recurse | ForEach ($_) { Remove-Item $_.fullname }